From 868081ff3a7d042e125684166468fd783e9aaee3 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 5 Apr 2021 10:48:11 +0000 Subject: [PATCH] Coding Standards: Give some variables in `WP_Importer` a more meaningful name. See #52627. git-svn-id: https://develop.svn.wordpress.org/trunk@50658 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-importer.php | 23 +++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/wp-admin/includes/class-wp-importer.php b/src/wp-admin/includes/class-wp-importer.php index f1b3710f46..a39fc60cd1 100644 --- a/src/wp-admin/includes/class-wp-importer.php +++ b/src/wp-admin/includes/class-wp-importer.php @@ -14,10 +14,10 @@ class WP_Importer { * @global wpdb $wpdb WordPress database abstraction object. * * @param string $importer_name - * @param string $bid + * @param string $blog_id * @return array */ - public function get_imported_posts( $importer_name, $bid ) { + public function get_imported_posts( $importer_name, $blog_id ) { global $wpdb; $hashtable = array(); @@ -27,7 +27,7 @@ class WP_Importer { // Grab all posts in chunks. do { - $meta_key = $importer_name . '_' . $bid . '_permalink'; + $meta_key = $importer_name . '_' . $blog_id . '_permalink'; $sql = $wpdb->prepare( "SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = %s LIMIT %d,%d", $meta_key, $offset, $limit ); $results = $wpdb->get_results( $sql ); @@ -54,16 +54,16 @@ class WP_Importer { * @global wpdb $wpdb WordPress database abstraction object. * * @param string $importer_name - * @param string $bid + * @param string $blog_id * @return int */ - public function count_imported_posts( $importer_name, $bid ) { + public function count_imported_posts( $importer_name, $blog_id ) { global $wpdb; $count = 0; // Get count of permalinks. - $meta_key = $importer_name . '_' . $bid . '_permalink'; + $meta_key = $importer_name . '_' . $blog_id . '_permalink'; $sql = $wpdb->prepare( "SELECT COUNT( post_id ) AS cnt FROM $wpdb->postmeta WHERE meta_key = %s", $meta_key ); $result = $wpdb->get_results( $sql ); @@ -83,10 +83,10 @@ class WP_Importer { * * @global wpdb $wpdb WordPress database abstraction object. * - * @param string $bid + * @param string $blog_id * @return array */ - public function get_imported_comments( $bid ) { + public function get_imported_comments( $blog_id ) { global $wpdb; $hashtable = array(); @@ -105,11 +105,12 @@ class WP_Importer { if ( ! empty( $results ) ) { foreach ( $results as $r ) { // Explode comment_agent key. - list ( $ca_bid, $source_comment_id ) = explode( '-', $r->comment_agent ); - $source_comment_id = (int) $source_comment_id; + list ( $comment_agent_blog_id, $source_comment_id ) = explode( '-', $r->comment_agent ); + + $source_comment_id = (int) $source_comment_id; // Check if this comment came from this blog. - if ( $bid == $ca_bid ) { + if ( $blog_id == $comment_agent_blog_id ) { $hashtable[ $source_comment_id ] = (int) $r->comment_ID; } }