diff --git a/admin/class-admin-apple-news-list-table.php b/admin/class-admin-apple-news-list-table.php index b73c0bd8..50345a28 100644 --- a/admin/class-admin-apple-news-list-table.php +++ b/admin/class-admin-apple-news-list-table.php @@ -172,6 +172,8 @@ public function column_title( $item ) { return; } + $apple_news_api_id = get_post_meta( $item->ID, 'apple_news_api_id', true ); + // Build the base URL. $base_url = add_query_arg( [ @@ -202,7 +204,7 @@ public function column_title( $item ) { $actions['push'] = sprintf( "%s", esc_url( Admin_Apple_Index_Page::action_query_params( 'push', $base_url ) ), - esc_html__( 'Publish', 'apple-news' ) + $apple_news_api_id ? esc_html__( 'Update', 'apple-news' ) : esc_html__( 'Publish', 'apple-news' ) ); } @@ -216,7 +218,7 @@ public function column_title( $item ) { } // Add the delete action, if required. - if ( get_post_meta( $item->ID, 'apple_news_api_id', true ) ) { + if ( $apple_news_api_id ) { $actions['delete'] = sprintf( "%s", esc_html__( 'Delete from Apple News', 'apple-news' ),