Coding Standards: Give some variables in `WP_Importer` a more meaningful name.

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50658


git-svn-id: http://core.svn.wordpress.org/trunk@50270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-04-05 10:50:03 +00:00
parent a338f84f32
commit b8f35c130c
2 changed files with 13 additions and 12 deletions

View File

@ -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;
}
}

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.8-alpha-50657';
$wp_version = '5.8-alpha-50658';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.