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.php

    r47113 r47119  
    332332                }
    333333
    334                 $plugin_data = get_plugin_data( "$plugin_root/$plugin_file", false, false ); //Do not apply markup/translate as it'll be cached.
     334                // Do not apply markup/translate as it will be cached.
     335                $plugin_data = get_plugin_data( "$plugin_root/$plugin_file", false, false );
    335336
    336337                if ( empty( $plugin_data['Name'] ) ) {
    … …  
    358359 */
    359360function get_mu_plugins() {
    360         $wp_plugins = array();
    361         // Files in wp-content/mu-plugins directory.
     361        $wp_plugins   = array();
    362362        $plugin_files = array();
    363363
    … …  
    365365                return $wp_plugins;
    366366        }
     367
     368        // Files in wp-content/mu-plugins directory.
    367369        $plugins_dir = @opendir( WPMU_PLUGIN_DIR );
    368370        if ( $plugins_dir ) {
    … …  
    387389                }
    388390
    389                 $plugin_data = get_plugin_data( WPMU_PLUGIN_DIR . "/$plugin_file", false, false ); //Do not apply markup/translate as it'll be cached.
     391                // Do not apply markup/translate as it will be cached.
     392                $plugin_data = get_plugin_data( WPMU_PLUGIN_DIR . "/$plugin_file", false, false );
    390393
    391394                if ( empty( $plugin_data['Name'] ) ) {
    … …  
    396399        }
    397400
    398         if ( isset( $wp_plugins['index.php'] ) && filesize( WPMU_PLUGIN_DIR . '/index.php' ) <= 30 ) { // silence is golden
     401        if ( isset( $wp_plugins['index.php'] ) && filesize( WPMU_PLUGIN_DIR . '/index.php' ) <= 30 ) {
     402                // Silence is golden.
    399403                unset( $wp_plugins['index.php'] );
    400404        }
    … …  
    432436        $_dropins = _get_dropins();
    433437
    434         // These exist in the wp-content directory.
     438        // Files in wp-content directory.
    435439        $plugins_dir = @opendir( WP_CONTENT_DIR );
    436440        if ( $plugins_dir ) {
    … …  
    454458                        continue;
    455459                }
    456                 $plugin_data = get_plugin_data( WP_CONTENT_DIR . "/$plugin_file", false, false ); //Do not apply markup/translate as it'll be cached.
     460
     461                // Do not apply markup/translate as it will be cached.
     462                $plugin_data = get_plugin_data( WP_CONTENT_DIR . "/$plugin_file", false, false );
     463
    457464                if ( empty( $plugin_data['Name'] ) ) {
    458465                        $plugin_data['Name'] = $plugin_file;
    459466                }
     467
    460468                $dropins[ $plugin_file ] = $plugin_data;
    461469        }
    … …  
    478486function _get_dropins() {
    479487        $dropins = array(
    480                 'advanced-cache.php'      => array( __( 'Advanced caching plugin.' ), 'WP_CACHE' ), // WP_CACHE
    481                 'db.php'                  => array( __( 'Custom database class.' ), true ), // auto on load
    482                 'db-error.php'            => array( __( 'Custom database error message.' ), true ), // auto on error
    483                 'install.php'             => array( __( 'Custom installation script.' ), true ), // auto on installation
    484                 'maintenance.php'         => array( __( 'Custom maintenance message.' ), true ), // auto on maintenance
    485                 'object-cache.php'        => array( __( 'External object cache.' ), true ), // auto on load
    486                 'php-error.php'           => array( __( 'Custom PHP error message.' ), true ), // auto on error
    487                 'fatal-error-handler.php' => array( __( 'Custom PHP fatal error handler.' ), true ), // auto on error
     488                'advanced-cache.php'      => array( __( 'Advanced caching plugin.' ), 'WP_CACHE' ),  // WP_CACHE
     489                'db.php'                  => array( __( 'Custom database class.' ), true ),          // Auto on load.
     490                'db-error.php'            => array( __( 'Custom database error message.' ), true ),  // Auto on error.
     491                'install.php'             => array( __( 'Custom installation script.' ), true ),     // Auto on installation.
     492                'maintenance.php'         => array( __( 'Custom maintenance message.' ), true ),     // Auto on maintenance.
     493                'object-cache.php'        => array( __( 'External object cache.' ), true ),          // Auto on load.
     494                'php-error.php'           => array( __( 'Custom PHP error message.' ), true ),       // Auto on error.
     495                'fatal-error-handler.php' => array( __( 'Custom PHP fatal error handler.' ), true ), // Auto on error.
    488496        );
    489497
    490498        if ( is_multisite() ) {
    491499                $dropins['sunrise.php']        = array( __( 'Executed before Multisite is loaded.' ), 'SUNRISE' ); // SUNRISE
    492                 $dropins['blog-deleted.php']   = array( __( 'Custom site deleted message.' ), true ); // auto on deleted blog
    493                 $dropins['blog-inactive.php']  = array( __( 'Custom site inactive message.' ), true ); // auto on inactive blog
    494                 $dropins['blog-suspended.php'] = array( __( 'Custom site suspended message.' ), true ); // auto on archived or spammed blog
     500                $dropins['blog-deleted.php']   = array( __( 'Custom site deleted message.' ), true );   // Auto on deleted blog.
     501                $dropins['blog-inactive.php']  = array( __( 'Custom site inactive message.' ), true );  // Auto on inactive blog.
     502                $dropins['blog-suspended.php'] = array( __( 'Custom site suspended message.' ), true ); // Auto on archived or spammed blog.
    495503        }
    496504
    … …  
    639647        if ( ( $network_wide && ! isset( $current[ $plugin ] ) ) || ( ! $network_wide && ! in_array( $plugin, $current ) ) ) {
    640648                if ( ! empty( $redirect ) ) {
    641                         wp_redirect( add_query_arg( '_error_nonce', wp_create_nonce( 'plugin-activation-error_' . $plugin ), $redirect ) ); // we'll override this later if the plugin can be included without fatal error
     649                        // We'll override this later if the plugin can be included without fatal error.
     650                        wp_redirect( add_query_arg( '_error_nonce', wp_create_nonce( 'plugin-activation-error_' . $plugin ), $redirect ) );
    642651                }
    643652
    … …  
    909918        if ( ! WP_Filesystem( $credentials ) ) {
    910919                ob_start();
    911                 request_filesystem_credentials( $url, '', true ); // Failed to connect, Error and request again.
     920                // Failed to connect. Error and request again.
     921                request_filesystem_credentials( $url, '', true );
    912922                $data = ob_get_clean();
    913923
    … …  
    959969
    960970                // If plugin is in its own directory, recursively delete the directory.
    961                 if ( strpos( $plugin_file, '/' ) && $this_plugin_dir != $plugins_dir ) { //base check on if plugin includes directory separator AND that it's not the root plugin folder
     971                // Base check on if plugin includes directory separator AND that it's not the root plugin folder.
     972                if ( strpos( $plugin_file, '/' ) && $this_plugin_dir != $plugins_dir ) {
    962973                        $deleted = $wp_filesystem->delete( $this_plugin_dir, true );
    963974                } else {
    … …  
    12381249
    12391250//
    1240 // Menu
     1251// Menu.
    12411252//
    12421253
    … …  
    13071318        $_registered_pages[ $hookname ] = true;
    13081319
    1309         // No parent as top level
     1320        // No parent as top level.
    13101321        $_parent_pages[ $menu_slug ] = false;
    13111322
    … …  
    14131424                }
    14141425        }
    1415         // Sort the parent array
     1426        // Sort the parent array.
    14161427        ksort( $submenu[ $parent_slug ] );
    14171428
    … …  
    17941805
    17951806//
    1796 // Pluggable Menu Support -- Private
     1807// Pluggable Menu Support -- Private.
    17971808//
    17981809/**
    … …  
    19331944                                }
    19341945
    1935                                 if ( $submenu_array[2] != $pagenow || isset( $_GET['page'] ) ) { // not the current page
     1946                                if ( $submenu_array[2] != $pagenow || isset( $_GET['page'] ) ) { // Not the current page.
    19361947                                        continue;
    19371948                                }
Note: See TracChangeset for help on using the changeset viewer.