WordPress.org

Make WordPress Core

Changeset 50658


Ignore:
Timestamp:
04/05/2021 10:48:11 AM (3 weeks ago)
Author:
SergeyBiryukov
Message:

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

See #52627.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-importer.php

    r49196 r50658  
    1515     *
    1616     * @param string $importer_name
    17      * @param string $bid
     17     * @param string $blog_id
    1818     * @return array
    1919     */
    20     public function get_imported_posts( $importer_name, $bid ) {
     20    public function get_imported_posts( $importer_name, $blog_id ) {
    2121        global $wpdb;
    2222
     
    2828        // Grab all posts in chunks.
    2929        do {
    30             $meta_key = $importer_name . '_' . $bid . '_permalink';
     30            $meta_key = $importer_name . '_' . $blog_id . '_permalink';
    3131            $sql      = $wpdb->prepare( "SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = %s LIMIT %d,%d", $meta_key, $offset, $limit );
    3232            $results  = $wpdb->get_results( $sql );
     
    5555     *
    5656     * @param string $importer_name
    57      * @param string $bid
     57     * @param string $blog_id
    5858     * @return int
    5959     */
    60     public function count_imported_posts( $importer_name, $bid ) {
     60    public function count_imported_posts( $importer_name, $blog_id ) {
    6161        global $wpdb;
    6262
     
    6464
    6565        // Get count of permalinks.
    66         $meta_key = $importer_name . '_' . $bid . '_permalink';
     66        $meta_key = $importer_name . '_' . $blog_id . '_permalink';
    6767        $sql      = $wpdb->prepare( "SELECT COUNT( post_id ) AS cnt FROM $wpdb->postmeta WHERE meta_key = %s", $meta_key );
    6868
     
    8484     * @global wpdb $wpdb WordPress database abstraction object.
    8585     *
    86      * @param string $bid
     86     * @param string $blog_id
    8787     * @return array
    8888     */
    89     public function get_imported_comments( $bid ) {
     89    public function get_imported_comments( $blog_id ) {
    9090        global $wpdb;
    9191
     
    106106                foreach ( $results as $r ) {
    107107                    // Explode comment_agent key.
    108                     list ( $ca_bid, $source_comment_id ) = explode( '-', $r->comment_agent );
    109                     $source_comment_id                   = (int) $source_comment_id;
     108                    list ( $comment_agent_blog_id, $source_comment_id ) = explode( '-', $r->comment_agent );
     109
     110                    $source_comment_id = (int) $source_comment_id;
    110111
    111112                    // Check if this comment came from this blog.
    112                     if ( $bid == $ca_bid ) {
     113                    if ( $blog_id == $comment_agent_blog_id ) {
    113114                        $hashtable[ $source_comment_id ] = (int) $r->comment_ID;
    114115                    }
Note: See TracChangeset for help on using the changeset viewer.