summary_json ) ? (string) $row->summary_json : ''; if ( '' === $raw ) { return array(); } $decoded = json_decode( $raw, true ); return is_array( $decoded ) ? $decoded : array(); }; $status_label = static function ( string $status ): string { $map = array( 'draft' => __( 'Draft', '4wp-drive' ), 'publish' => __( 'Published', '4wp-drive' ), 'pending' => __( 'Pending', '4wp-drive' ), 'private' => __( 'Private', '4wp-drive' ), 'future' => __( 'Scheduled', '4wp-drive' ), 'trash' => __( 'Trash', '4wp-drive' ), ); return $map[ $status ] ?? ( $status !== '' ? $status : '—' ); }; $tax_label = static function ( string $taxonomy ): string { if ( function_exists( 'get_taxonomy' ) ) { $obj = get_taxonomy( $taxonomy ); if ( $obj && ! empty( $obj->labels->name ) ) { return (string) $obj->labels->name; } } $map = array( 'category' => __( 'Categories', '4wp-drive' ), 'post_tag' => __( 'Tags', '4wp-drive' ), ); return $map[ $taxonomy ] ?? $taxonomy; }; $summary_rows = static function ( array $summary ) use ( $tax_label ): array { $rows = array(); $chars = isset( $summary['chars'] ) ? (int) $summary['chars'] : 0; $images = isset( $summary['images'] ) ? (int) $summary['images'] : 0; $rows[] = array( 'label' => __( 'Chars', '4wp-drive' ), 'value' => (string) number_format_i18n( $chars ), ); $rows[] = array( 'label' => __( 'Images', '4wp-drive' ), 'value' => (string) number_format_i18n( $images ), ); if ( ! empty( $summary['featured'] ) ) { $rows[] = array( 'label' => __( 'Featured', '4wp-drive' ), 'value' => __( 'yes', '4wp-drive' ), ); } $tax = isset( $summary['taxonomies'] ) && is_array( $summary['taxonomies'] ) ? $summary['taxonomies'] : array(); foreach ( $tax as $taxonomy => $names ) { if ( ! is_array( $names ) || empty( $names ) ) { continue; } if ( function_exists( 'get_taxonomy' ) ) { $obj = get_taxonomy( (string) $taxonomy ); if ( $obj && empty( $obj->public ) ) { continue; } } $rows[] = array( 'label' => $tax_label( (string) $taxonomy ), 'value' => implode( ', ', array_map( 'strval', $names ) ), ); } return $rows; }; ?>

source ?? '' ); $source_obj = Source_Registry::get( $source_slug ); $source_label = $source_obj ? $source_obj->get_label() : $source_slug; $post_id = (int) ( $row->post_id ?? 0 ); $post_type = (string) ( $row->post_type ?? 'post' ); $pto = get_post_type_object( $post_type ); $type_label = $pto ? (string) $pto->labels->singular_name : $post_type; $post = $post_id > 0 ? get_post( $post_id ) : null; $edit_url = $post ? get_edit_post_link( $post_id, 'raw' ) : ''; $mode = (string) ( $row->mode ?? 'create' ); $summary = $decode_summary( $row ); $live_status = $post ? (string) $post->post_status : (string) ( $summary['status'] ?? '' ); $imported_at = (string) ( $row->imported_at ?? '' ); $detail_rows = $summary_rows( $summary ); ?>
0 ) : ?> — —
1 ) : ?>
add_query_arg( 'paged', '%#%' ), 'format' => '', 'current' => $page, 'total' => $pages, 'prev_text' => '«', 'next_text' => '»', ) ) ); ?>