Make WordPress Core

Ticket #48191: 48191.patch

File 48191.patch, 3.6 KB (added by dkarfa, 5 years ago)
  • src/wp-admin/includes/plugin.php

     
    8585
    8686        $plugin_data = get_file_data( $plugin_file, $default_headers, 'plugin' );
    8787
    88         // Site Wide Only is the old header for Network
     88        // Site Wide Only is the old header for Network.
    8989        if ( ! $plugin_data['Network'] && $plugin_data['_sitewide'] ) {
    9090                /* translators: 1: Site Wide Only: true, 2: Network: true */
    9191                _deprecated_argument( __FUNCTION__, '3.0.0', sprintf( __( 'The %1$s plugin header is deprecated. Use %2$s instead.' ), '<code>Site Wide Only: true</code>', '<code>Network: true</code>' ) );
     
    142142 */
    143143function _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup = true, $translate = true ) {
    144144
    145         // Sanitize the plugin filename to a WP_PLUGIN_DIR relative path
     145        // Sanitize the plugin filename to a WP_PLUGIN_DIR relative path.
    146146        $plugin_file = plugin_basename( $plugin_file );
    147147
    148         // Translate fields
     148        // Translate fields.
    149149        if ( $translate ) {
    150150                $textdomain = $plugin_data['TextDomain'];
    151151                if ( $textdomain ) {
     
    167167                }
    168168        }
    169169
    170         // Sanitize fields
     170        // Sanitize fields.
    171171        $allowed_tags_in_links = array(
    172172                'abbr'    => array( 'title' => true ),
    173173                'acronym' => array( 'title' => true ),
     
    196196        $plugin_data['Title']      = $plugin_data['Name'];
    197197        $plugin_data['AuthorName'] = $plugin_data['Author'];
    198198
    199         // Apply markup
     199        // Apply markup.
    200200        if ( $markup ) {
    201201                if ( $plugin_data['PluginURI'] && $plugin_data['Name'] ) {
    202202                        $plugin_data['Title'] = '<a href="' . $plugin_data['PluginURI'] . '">' . $plugin_data['Name'] . '</a>';
     
    292292                $plugin_root .= $plugin_folder;
    293293        }
    294294
    295         // Files in wp-content/plugins directory
     295        // Files in wp-content/plugins directory.
    296296        $plugins_dir  = @ opendir( $plugin_root );
    297297        $plugin_files = array();
    298298        if ( $plugins_dir ) {
     
    358358 */
    359359function get_mu_plugins() {
    360360        $wp_plugins = array();
    361         // Files in wp-content/mu-plugins directory
     361        // Files in wp-content/mu-plugins directory.
    362362        $plugin_files = array();
    363363
    364364        if ( ! is_dir( WPMU_PLUGIN_DIR ) ) {
     
    431431
    432432        $_dropins = _get_dropins();
    433433
    434         // These exist in the wp-content directory
     434        // These exist in the wp-content directory.
    435435        $plugins_dir = @opendir( WP_CONTENT_DIR );
    436436        if ( $plugins_dir ) {
    437437                while ( ( $file = readdir( $plugins_dir ) ) !== false ) {
     
    477477 */
    478478function _get_dropins() {
    479479        $dropins = array(
    480                 'advanced-cache.php'      => array( __( 'Advanced caching plugin.' ), 'WP_CACHE' ), // WP_CACHE
     480                'advanced-cache.php'      => array( __( 'Advanced caching plugin.' ), 'WP_CACHE' ), // WP_CACHE    d
    481481                'db.php'                  => array( __( 'Custom database class.' ), true ), // auto on load
    482482                'db-error.php'            => array( __( 'Custom database error message.' ), true ), // auto on error
    483483                'install.php'             => array( __( 'Custom installation script.' ), true ), // auto on installation
     
    15371537 * @param int      $position   The position in the menu order this item should appear.
    15381538 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
    15391539 */
    1540 
    15411540function add_users_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {
    15421541        if ( current_user_can( 'edit_users' ) ) {
    15431542                $parent = 'users.php';
     
    15461545        }
    15471546        return add_submenu_page( $parent, $page_title, $menu_title, $capability, $menu_slug, $function, $position );
    15481547}
     1548
    15491549/**
    15501550 * Add submenu page to the Dashboard main menu.
    15511551 *