Make WordPress Core

Ticket #32101: 32101.2.diff

File 32101.2.diff, 3.7 KB (added by DrewAPicture, 10 years ago)
  • src/wp-admin/includes/plugin.php

     
    3131 *     Network: Optional. Specify "Network: true" to require that a plugin is activated
    3232 *              across all sites in an installation. This will prevent a plugin from being
    3333 *              activated on a single site when Multisite is enabled.
     34 *     Private: Optional. Specify "Private: true" to exclude the plugin from update checks.
    3435 *      * / # Remove the space to close comment
    3536 *
    3637 * Some users have issues with opening large files and manipulating the contents
     
    6364 *     @type string $TextDomain  Plugin textdomain.
    6465 *     @type string $DomainPath  Plugins relative directory path to .mo files.
    6566 *     @type bool   $Network     Whether the plugin can only be activated network-wide.
     67 *     @type bool $Private Whether the plugin should be excluded from update checks.
    6668 * }
    6769 */
    6870function get_plugin_data( $plugin_file, $markup = true, $translate = true ) {
     
    7779                'TextDomain' => 'Text Domain',
    7880                'DomainPath' => 'Domain Path',
    7981                'Network' => 'Network',
     82                'Private' => 'Private',
    8083                // Site Wide Only is deprecated in favor of Network.
    8184                '_sitewide' => 'Site Wide Only',
    8285        );
     
    9295        $plugin_data['Network'] = ( 'true' == strtolower( $plugin_data['Network'] ) );
    9396        unset( $plugin_data['_sitewide'] );
    9497
     98        $plugin_data['Private'] = ( 'true' == strtolower( $plugin_data['Private'] ) );
     99
    95100        if ( $markup || $translate ) {
    96101                $plugin_data = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup, $translate );
    97102        } else {
  • src/wp-includes/class-wp-theme.php

     
    3838                'Tags'        => 'Tags',
    3939                'TextDomain'  => 'Text Domain',
    4040                'DomainPath'  => 'Domain Path',
     41                'Private'     => 'Private',
    4142        );
    4243
    4344        /**
     
    574575         * whether it is actually valid.
    575576         *
    576577         * @since 3.4.0
     578         * @since 4.4.0 Added the 'Private' header.
    577579         * @access public
    578580         *
    579          * @param string $header Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags.
     581         * @param string $header Theme header. Accepts 'Name', 'Description', 'Author', 'Version', 'ThemeURI',
     582         *                       'AuthorURI', 'Status', 'Tags', 'TextDomain', 'DomainPath', or 'Private'.
    580583         * @return string|false String on success, false on failure.
    581584         */
    582585        public function get( $header ) {
     
    687690                        case 'Version' :
    688691                                $value = strip_tags( $value );
    689692                                break;
     693                        case 'Private' :
     694                                $value = 'true' === strtolower( $value );
     695                                break;
    690696                }
    691697
    692698                return $value;
  • src/wp-includes/update.php

     
    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() );
     
    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'),