Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:33:45 AM (7 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve comments in some wp-admin files per the documentation standards.

Follow-up to [47084].

Props passoniate, apedog.
Fixes #49223, #49227.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin-install.php

    r46463 r47119  
    101101 */
    102102function plugins_api( $action, $args = array() ) {
    103         // include an unmodified $wp_version
     103        // Include an unmodified $wp_version.
    104104        include( ABSPATH . WPINC . '/version.php' );
    105105
     
    119119
    120120        if ( ! isset( $args->wp_version ) ) {
    121                 $args->wp_version = substr( $wp_version, 0, 3 ); // X.y
     121                $args->wp_version = substr( $wp_version, 0, 3 ); // x.y
    122122        }
    123123
     
    286286                echo $api_tags->get_error_message();
    287287        } else {
    288                 //Set up the tags in a way which can be interpreted by wp_generate_tag_cloud()
     288                // Set up the tags in a way which can be interpreted by wp_generate_tag_cloud().
    289289                $tags = array();
    290290                foreach ( (array) $api_tags as $tag ) {
     
    438438        }
    439439
    440         // Default to a "new" plugin
     440        // Default to a "new" plugin.
    441441        $status      = 'install';
    442442        $url         = false;
     
    471471                                }
    472472                        } else {
    473                                 $key         = array_keys( $installed_plugin );
    474                                 $key         = reset( $key ); //Use the first plugin regardless of the name, Could have issues for multiple-plugins in one directory if they share different version numbers
     473                                $key = array_keys( $installed_plugin );
     474                                // Use the first plugin regardless of the name.
     475                                // Could have issues for multiple plugins in one directory if they share different version numbers.
     476                                $key = reset( $key );
     477
    475478                                $update_file = $api->slug . '/' . $key;
    476479                                if ( version_compare( $api->version, $installed_plugin[ $key ]['Version'], '=' ) ) {
     
    480483                                        $version = $installed_plugin[ $key ]['Version'];
    481484                                } else {
    482                                         //If the above update check failed, Then that probably means that the update checker has out-of-date information, force a refresh
     485                                        // If the above update check failed, then that probably means that the update checker has out-of-date information, force a refresh.
    483486                                        if ( ! $loop ) {
    484487                                                delete_site_transient( 'update_plugins' );
     
    489492                        }
    490493                } else {
    491                         // "install" & no directory with that slug
     494                        // "install" & no directory with that slug.
    492495                        if ( current_user_can( 'install_plugins' ) ) {
    493496                                $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $api->slug ), 'install-plugin_' . $api->slug );
     
    571574        );
    572575
    573         // Sanitize HTML
     576        // Sanitize HTML.
    574577        foreach ( (array) $api->sections as $section_name => $content ) {
    575578                $api->sections[ $section_name ] = wp_kses( $content, $plugins_allowedtags );
     
    584587        $_tab = esc_attr( $tab );
    585588
    586         $section = isset( $_REQUEST['section'] ) ? wp_unslash( $_REQUEST['section'] ) : 'description'; // Default to the Description tab, Do not translate, API returns English.
     589        // Default to the Description tab, Do not translate, API returns English.
     590        $section = isset( $_REQUEST['section'] ) ? wp_unslash( $_REQUEST['section'] ) : 'description';
    587591        if ( empty( $section ) || ! isset( $api->sections[ $section ] ) ) {
    588592                $section_titles = array_keys( (array) $api->sections );
Note: See TracChangeset for help on using the changeset viewer.