Make WordPress Core

Changeset 28518


Ignore:
Timestamp:
05/19/2014 06:16:39 AM (10 years ago)
Author:
wonderboymusic
Message:

Add missing access modifiers to methods in WP_Scripts and WP_Styles.

See #27881, #22234.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class.wp-scripts.php

    r27731 r28518  
    1818 */
    1919class WP_Scripts extends WP_Dependencies {
    20     var $base_url; // Full URL with trailing slash
    21     var $content_url;
    22     var $default_version;
    23     var $in_footer = array();
    24     var $concat = '';
    25     var $concat_version = '';
    26     var $do_concat = false;
    27     var $print_html = '';
    28     var $print_code = '';
    29     var $ext_handles = '';
    30     var $ext_version = '';
    31     var $default_dirs;
    32 
    33     function __construct() {
     20    public $base_url; // Full URL with trailing slash
     21    public $content_url;
     22    public $default_version;
     23    public $in_footer = array();
     24    public $concat = '';
     25    public $concat_version = '';
     26    public $do_concat = false;
     27    public $print_html = '';
     28    public $print_code = '';
     29    public $ext_handles = '';
     30    public $ext_version = '';
     31    public $default_dirs;
     32
     33    public function __construct() {
    3434        $this->init();
    3535        add_action( 'init', array( $this, 'init' ), 0 );
    3636    }
    3737
    38     function init() {
     38    public function init() {
    3939        /**
    4040         * Fires when the WP_Scripts instance is initialized.
     
    5656     * @return array Scripts that have been printed
    5757     */
    58     function print_scripts( $handles = false, $group = false ) {
     58    public function print_scripts( $handles = false, $group = false ) {
    5959        return $this->do_items( $handles, $group );
    6060    }
    6161
    6262    // Deprecated since 3.3, see print_extra_script()
    63     function print_scripts_l10n( $handle, $echo = true ) {
     63    public function print_scripts_l10n( $handle, $echo = true ) {
    6464        _deprecated_function( __FUNCTION__, '3.3', 'print_extra_script()' );
    6565        return $this->print_extra_script( $handle, $echo );
    6666    }
    6767
    68     function print_extra_script( $handle, $echo = true ) {
     68    public function print_extra_script( $handle, $echo = true ) {
    6969        if ( !$output = $this->get_data( $handle, 'data' ) )
    7070            return;
     
    8282    }
    8383
    84     function do_item( $handle, $group = false ) {
     84    public function do_item( $handle, $group = false ) {
    8585        if ( !parent::do_item($handle) )
    8686            return false;
     
    152152     * Localizes only if the script has already been added
    153153     */
    154     function localize( $handle, $object_name, $l10n ) {
     154    public function localize( $handle, $object_name, $l10n ) {
    155155        if ( $handle === 'jquery' )
    156156            $handle = 'jquery-core';
     
    181181    }
    182182
    183     function set_group( $handle, $recursion, $group = false ) {
     183    public function set_group( $handle, $recursion, $group = false ) {
    184184
    185185        if ( $this->registered[$handle]->args === 1 )
     
    194194    }
    195195
    196     function all_deps( $handles, $recursion = false, $group = false ) {
     196    public function all_deps( $handles, $recursion = false, $group = false ) {
    197197        $r = parent::all_deps( $handles, $recursion );
    198198        if ( ! $recursion ) {
     
    209209    }
    210210
    211     function do_head_items() {
     211    public function do_head_items() {
    212212        $this->do_items(false, 0);
    213213        return $this->done;
    214214    }
    215215
    216     function do_footer_items() {
     216    public function do_footer_items() {
    217217        $this->do_items(false, 1);
    218218        return $this->done;
    219219    }
    220220
    221     function in_default_dir($src) {
     221    public function in_default_dir($src) {
    222222        if ( ! $this->default_dirs )
    223223            return true;
     
    233233    }
    234234
    235     function reset() {
     235    public function reset() {
    236236        $this->do_concat = false;
    237237        $this->print_code = '';
  • trunk/src/wp-includes/class.wp-styles.php

    r28209 r28518  
    1818 */
    1919class WP_Styles extends WP_Dependencies {
    20     var $base_url;
    21     var $content_url;
    22     var $default_version;
    23     var $text_direction = 'ltr';
    24     var $concat = '';
    25     var $concat_version = '';
    26     var $do_concat = false;
    27     var $print_html = '';
    28     var $print_code = '';
    29     var $default_dirs;
    30 
    31     function __construct() {
     20    public $base_url;
     21    public $content_url;
     22    public $default_version;
     23    public $text_direction = 'ltr';
     24    public $concat = '';
     25    public $concat_version = '';
     26    public $do_concat = false;
     27    public $print_html = '';
     28    public $print_code = '';
     29    public $default_dirs;
     30
     31    public function __construct() {
    3232        /**
    3333         * Fires when the WP_Styles instance is initialized.
     
    4040    }
    4141
    42     function do_item( $handle ) {
     42    public function do_item( $handle ) {
    4343        if ( !parent::do_item($handle) )
    4444            return false;
     
    120120    }
    121121
    122     function add_inline_style( $handle, $code ) {
     122    public function add_inline_style( $handle, $code ) {
    123123        if ( !$code )
    124124            return false;
     
    133133    }
    134134
    135     function print_inline_style( $handle, $echo = true ) {
     135    public function print_inline_style( $handle, $echo = true ) {
    136136        $output = $this->get_data( $handle, 'after' );
    137137
     
    151151    }
    152152
    153     function all_deps( $handles, $recursion = false, $group = false ) {
     153    public function all_deps( $handles, $recursion = false, $group = false ) {
    154154        $r = parent::all_deps( $handles, $recursion );
    155155        if ( !$recursion ) {
     
    166166    }
    167167
    168     function _css_href( $src, $ver, $handle ) {
     168    public function _css_href( $src, $ver, $handle ) {
    169169        if ( !is_bool($src) && !preg_match('|^(https?:)?//|', $src) && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) {
    170170            $src = $this->base_url . $src;
     
    186186    }
    187187
    188     function in_default_dir($src) {
     188    public function in_default_dir($src) {
    189189        if ( ! $this->default_dirs )
    190190            return true;
     
    197197    }
    198198
    199     function do_footer_items() { // HTML 5 allows styles in the body, grab late enqueued items and output them in the footer.
     199    public function do_footer_items() { // HTML 5 allows styles in the body, grab late enqueued items and output them in the footer.
    200200        $this->do_items(false, 1);
    201201        return $this->done;
    202202    }
    203203
    204     function reset() {
     204    public function reset() {
    205205        $this->do_concat = false;
    206206        $this->concat = '';
Note: See TracChangeset for help on using the changeset viewer.