WordPress.org

Make WordPress Core

Ticket #32101: 32101.diff

File 32101.diff, 3.5 KB (added by markjaquith, 4 years ago)
  • src/wp-admin/includes/plugin.php

    diff --git src/wp-admin/includes/plugin.php src/wp-admin/includes/plugin.php
    index 233d990..f26637c 100644
     
    4646 * - 'TextDomain' - Plugin's text domain for localization.
    4747 * - 'DomainPath' - Plugin's relative directory path to .mo files.
    4848 * - 'Network' - Boolean. Whether the plugin can only be activated network wide.
     49 * - 'Private' - Boolean. Whether the plugin should be excluded from update checks.
    4950 *
    5051 * Some users have issues with opening large files and manipulating the contents
    5152 * for want is usually the first 1kiB or 2kiB. This function stops pulling in
    function get_plugin_data( $plugin_file, $markup = true, $translate = true ) { 
    8182                'TextDomain' => 'Text Domain',
    8283                'DomainPath' => 'Domain Path',
    8384                'Network' => 'Network',
     85                'Private' => 'Private',
    8486                // Site Wide Only is deprecated in favor of Network.
    8587                '_sitewide' => 'Site Wide Only',
    8688        );
    function get_plugin_data( $plugin_file, $markup = true, $translate = true ) { 
    9597        $plugin_data['Network'] = ( 'true' == strtolower( $plugin_data['Network'] ) );
    9698        unset( $plugin_data['_sitewide'] );
    9799
     100        $plugin_data['Private'] = ( 'true' == strtolower( $plugin_data['Private'] ) );
     101
    98102        if ( $markup || $translate ) {
    99103                $plugin_data = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup, $translate );
    100104        } else {
  • src/wp-includes/class-wp-theme.php

    diff --git src/wp-includes/class-wp-theme.php src/wp-includes/class-wp-theme.php
    index ad70a4b..223040a 100644
    final class WP_Theme implements ArrayAccess { 
    2727                'Tags'        => 'Tags',
    2828                'TextDomain'  => 'Text Domain',
    2929                'DomainPath'  => 'Domain Path',
     30                'Private'     => 'Private',
    3031        );
    3132
    3233        /**
    final class WP_Theme implements ArrayAccess { 
    565566         * @since 3.4.0
    566567         * @access public
    567568         *
    568          * @param string $header Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags.
     569         * @param string $header Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags, Private.
    569570         * @return string|false String on success, false on failure.
    570571         */
    571572        public function get( $header ) {
    final class WP_Theme implements ArrayAccess { 
    670671                        case 'AuthorURI' :
    671672                                $value = esc_url_raw( $value );
    672673                                break;
     674                        case 'Private' :
     675                                $value = 'true' === strtolower( $value );
     676                                break;
    673677                        case 'Tags' :
    674678                                $value = array_filter( array_map( 'trim', explode( ',', strip_tags( $value ) ) ) );
    675679                                break;
  • src/wp-includes/update.php

    diff --git src/wp-includes/update.php src/wp-includes/update.php
    index c39322e..19ceef5 100644
    function wp_update_plugins( $extra_stats = array() ) { 
    200200                require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
    201201
    202202        $plugins = get_plugins();
     203
     204        // Omit private plugins
     205        foreach ( $plugins as $file => $p ) {
     206                if ( $p['Private'] ) {
     207                        unset( $plugins[$file] );
     208                }
     209        }
     210
    203211        $translations = wp_get_installed_translations( 'plugins' );
    204212
    205213        $active  = get_option( 'active_plugins', array() );
    function wp_update_themes( $extra_stats = array() ) { 
    366374        foreach ( $installed_themes as $theme ) {
    367375                $checked[ $theme->get_stylesheet() ] = $theme->get('Version');
    368376
     377                // Omit private themes
     378                if ( $theme->get('Private') ) {
     379                        continue;
     380                }
     381
    369382                $themes[ $theme->get_stylesheet() ] = array(
    370383                        'Name'       => $theme->get('Name'),
    371384                        'Title'      => $theme->get('Name'),