WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (2 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve inline comments per the documentation standards.

Includes minor code layout fixes for better readability.

See #48303.

File:
1 edited

Legend:

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

    r45730 r47122  
    2626        $offset = 0;
    2727
    28         // Grab all posts in chunks
     28        // Grab all posts in chunks.
    2929        do {
    3030            $meta_key = $importer_name . '_' . $bid . '_permalink';
     
    3232            $results  = $wpdb->get_results( $sql );
    3333
    34             // Increment offset
     34            // Increment offset.
    3535            $offset = ( $limit + $offset );
    3636
    3737            if ( ! empty( $results ) ) {
    3838                foreach ( $results as $r ) {
    39                     // Set permalinks into array
     39                    // Set permalinks into array.
    4040                    $hashtable[ $r->meta_value ] = intval( $r->post_id );
    4141                }
     
    6363        $count = 0;
    6464
    65         // Get count of permalinks
     65        // Get count of permalinks.
    6666        $meta_key = $importer_name . '_' . $bid . '_permalink';
    6767        $sql      = $wpdb->prepare( "SELECT COUNT( post_id ) AS cnt FROM $wpdb->postmeta WHERE meta_key = %s", $meta_key );
     
    9595        $offset = 0;
    9696
    97         // Grab all comments in chunks
     97        // Grab all comments in chunks.
    9898        do {
    9999            $sql     = $wpdb->prepare( "SELECT comment_ID, comment_agent FROM $wpdb->comments LIMIT %d,%d", $offset, $limit );
    100100            $results = $wpdb->get_results( $sql );
    101101
    102             // Increment offset
     102            // Increment offset.
    103103            $offset = ( $limit + $offset );
    104104
    105105            if ( ! empty( $results ) ) {
    106106                foreach ( $results as $r ) {
    107                     // Explode comment_agent key
     107                    // Explode comment_agent key.
    108108                    list ( $ca_bid, $source_comment_id ) = explode( '-', $r->comment_agent );
    109109                    $source_comment_id                   = intval( $source_comment_id );
    110110
    111                     // Check if this comment came from this blog
     111                    // Check if this comment came from this blog.
    112112                    if ( $bid == $ca_bid ) {
    113113                        $hashtable[ $source_comment_id ] = intval( $r->comment_ID );
     
    204204     */
    205205    public function get_page( $url, $username = '', $password = '', $head = false ) {
    206         // Increase the timeout
     206        // Increase the timeout.
    207207        add_filter( 'http_request_timeout', array( $this, 'bump_request_timeout' ) );
    208208
     
    268268        // Or define( 'WP_IMPORTING', true );
    269269        $wpdb->queries = array();
    270         // Reset $wp_actions to keep it from growing out of control
     270        // Reset $wp_actions to keep it from growing out of control.
    271271        $wp_actions = array();
    272272    }
     
    318318    }
    319319
    320     // Check array for specified param
     320    // Check array for specified param.
    321321    if ( isset( $out[ $param ] ) ) {
    322         // Set return value
     322        // Set return value.
    323323        $return = $out[ $param ];
    324324    }
    325325
    326     // Check for missing required param
     326    // Check for missing required param.
    327327    if ( ! isset( $out[ $param ] ) && $required ) {
    328         // Display message and exit
     328        // Display message and exit.
    329329        echo "\"$param\" parameter is required but was not specified\n";
    330330        exit();
Note: See TracChangeset for help on using the changeset viewer.