Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (5 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/plugins.php

    r47093 r47122  
    6464
    6565            if ( isset( $_GET['from'] ) && 'import' == $_GET['from'] ) {
    66                 wp_redirect( self_admin_url( 'import.php?import=' . str_replace( '-importer', '', dirname( $plugin ) ) ) ); // overrides the ?error=true one above and redirects to the Imports page, stripping the -importer suffix
     66                // Overrides the ?error=true one above and redirects to the Imports page, stripping the -importer suffix.
     67                wp_redirect( self_admin_url( 'import.php?import=' . str_replace( '-importer', '', dirname( $plugin ) ) ) );
    6768            } elseif ( isset( $_GET['from'] ) && 'press-this' == $_GET['from'] ) {
    6869                wp_redirect( self_admin_url( 'press-this.php' ) );
    6970            } else {
    70                 wp_redirect( self_admin_url( "plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s" ) ); // overrides the ?error=true one above
     71                // Overrides the ?error=true one above.
     72                wp_redirect( self_admin_url( "plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s" ) );
    7173            }
    7274            exit;
     
    171173            }
    172174
    173             ini_set( 'display_errors', true ); //Ensure that Fatal errors are displayed.
    174             // Go back to "sandbox" scope so we get the same errors as before
     175            ini_set( 'display_errors', true ); // Ensure that fatal errors are displayed.
     176            // Go back to "sandbox" scope so we get the same errors as before.
    175177            plugin_sandbox_scrape( $plugin );
    176178            /** This action is documented in wp-admin/includes/plugin.php */
     
    255257            check_admin_referer( 'bulk-plugins' );
    256258
    257             //$_POST = from the plugin form; $_GET = from the FTP details screen.
     259            // $_POST = from the plugin form; $_GET = from the FTP details screen.
    258260            $plugins = isset( $_REQUEST['checked'] ) ? (array) wp_unslash( $_REQUEST['checked'] ) : array();
    259261            if ( empty( $plugins ) ) {
     
    262264            }
    263265
    264             $plugins = array_filter( $plugins, 'is_plugin_inactive' ); // Do not allow to delete Activated plugins.
     266            $plugins = array_filter( $plugins, 'is_plugin_inactive' ); // Do not allow to delete activated plugins.
    265267            if ( empty( $plugins ) ) {
    266268                wp_redirect( self_admin_url( "plugins.php?error=true&main=true&plugin_status=$status&paged=$page&s=$s" ) );
     
    269271
    270272            // Bail on all if any paths are invalid.
    271             // validate_file() returns truthy for invalid files
     273            // validate_file() returns truthy for invalid files.
    272274            $invalid_plugin_files = array_filter( $plugins, 'validate_file' );
    273275            if ( $invalid_plugin_files ) {
     
    376378            } else {
    377379                $plugins_to_delete = count( $plugins );
    378             } // endif verify-delete
     380            } // End if verify-delete.
    379381
    380382            $delete_result = delete_plugins( $plugins );
    381383
    382             set_transient( 'plugins_delete_result_' . $user_ID, $delete_result ); //Store the result in a cache rather than a URL param due to object type & length
     384            // Store the result in a cache rather than a URL param due to object type & length.
     385            set_transient( 'plugins_delete_result_' . $user_ID, $delete_result );
    383386            wp_redirect( self_admin_url( "plugins.php?deleted=$plugins_to_delete&plugin_status=$status&paged=$page&s=$s" ) );
    384387            exit;
     
    421424
    422425                /** This action is documented in wp-admin/edit.php */
    423                 $sendback = apply_filters( "handle_bulk_actions-{$screen}", $sendback, $action, $plugins );  // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
     426                $sendback = apply_filters( "handle_bulk_actions-{$screen}", $sendback, $action, $plugins ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    424427                wp_safe_redirect( $sendback );
    425428                exit;
Note: See TracChangeset for help on using the changeset viewer.