Make WordPress Core

Ticket #35964: 35964.patch

File 35964.patch, 13.7 KB (added by ocean90, 9 years ago)
  • src/wp-includes/class.wp-dependencies.php

     
    7777        public $group = 0;
    7878
    7979        /**
    80          * Process the items and dependencies.
     80         * Processes the items and dependencies.
    8181         *
    8282         * Processes the items passed to it or the queue, and their dependencies.
    8383         *
     
    116116        }
    117117
    118118        /**
    119          * Process a dependency.
     119         * Processes a dependency.
    120120         *
    121121         * @access public
    122122         * @since 2.6.0
     
    129129        }
    130130
    131131        /**
    132          * Determine dependencies.
     132         * Determines dependencies.
    133133         *
    134134         * Recursively builds an array of items to process taking
    135135         * dependencies into account. Does NOT catch infinite loops.
     
    139139         * @since 2.6.0 Moved from `WP_Scripts`.
    140140         * @since 2.8.0 Added the `$group` parameter.
    141141         *
    142          * @param mixed $handles   Item handle and argument (string) or item handles and arguments (array of strings).
    143          * @param bool  $recursion Internal flag that function is calling itself.
    144          * @param mixed $group     Group level: (int) level, (false) no groups.
     142         * @param mixed     $handles   Item handle and argument (string) or item handles and arguments (array of strings).
     143         * @param bool      $recursion Internal flag that function is calling itself.
     144         * @param int|false $group     Group level: (int) level, (false) no groups.
    145145         * @return bool True on success, false on failure.
    146146         */
    147147        public function all_deps( $handles, $recursion = false, $group = false ) {
  • src/wp-includes/class.wp-scripts.php

     
    2929        public $base_url;
    3030
    3131        /**
     32         * URL of the content URL.
    3233         *
     34         * Usually the value of `WP_CONTENT_URL`.
     35         *
    3336         * @since 2.8.0
    3437         * @access public
    3538         * @var string
     
    3740        public $content_url;
    3841
    3942        /**
     43         * Default version string for stylesheets.
    4044         *
     45         * Usually the value of `get_bloginfo( 'version' )`.
     46         *
    4147         * @since 2.6.0
    4248         * @access public
    4349         * @var string
     
    4551        public $default_version;
    4652
    4753        /**
     54         * Holds handles of scripts which are enqueued in footer.
    4855         *
    4956         * @since 2.8.0
    5057         * @access public
     
    5360        public $in_footer = array();
    5461
    5562        /**
     63         * Holds list of script handles which will be concatenated.
    5664         *
    5765         * @since 2.8.0
    5866         * @access public
     
    6169        public $concat = '';
    6270
    6371        /**
     72         * Holds a string which contains script handles and their version.
    6473         *
    6574         * @since 2.8.0
     75         * @deprecated 3.4.0
    6676         * @access public
    6777         * @var string
    6878         */
    6979        public $concat_version = '';
    7080
    7181        /**
     82         * Whether to perform concatenation.
    7283         *
    7384         * @since 2.8.0
    7485         * @access public
     
    7788        public $do_concat = false;
    7889
    7990        /**
     91         * Holds HTML markup of scripts and additional data if concatenation
     92         * is enabled.
    8093         *
    8194         * @since 2.8.0
    8295         * @access public
     
    93106        public $print_html_before = '';
    94107
    95108        /**
     109         * Holds inline code if concatenation is enabled.
    96110         *
    97111         * @since 2.8.0
    98112         * @access public
     
    101115        public $print_code = '';
    102116
    103117        /**
     118         * Holds list of script handles which are not in the default directory
     119         * if concatenation is enabled.
    104120         *
    105121         * @since 2.8.0
    106122         * @access public
     
    109125        public $ext_handles = '';
    110126
    111127        /**
     128         * Holds a string which contains handles and versions of scripts which
     129         * are not in the default directory if concatenation is enabled.
    112130         *
    113131         * @since 2.8.0
    114132         * @access public
     
    117135        public $ext_version = '';
    118136
    119137        /**
     138         * List of default directories.
    120139         *
    121140         * @since 2.8.0
    122141         * @access public
     
    172191        }
    173192
    174193        /**
     194         * Prints extra scripts of a registered script.
    175195         *
    176196         * @since 2.1.0
    177197         * @since 2.8.0 Added the `$echo` parameter.
     
    180200         *
    181201         * @see print_extra_script()
    182202         *
    183          * @param string $handle
    184          * @param bool   $echo
    185          * @return bool|string|void
     203         * @param string $handle The script's registered handle.
     204         * @param bool   $echo   Optional. Whether to echo the extra script instead of just returning it.
     205         *                       Default true.
     206         * @return bool|string|void Void if no data exists, extra scripts if `$echo` is true, true otherwise.
    186207         */
    187208        public function print_scripts_l10n( $handle, $echo = true ) {
    188209                _deprecated_function( __FUNCTION__, '3.3', 'print_extra_script()' );
     
    190211        }
    191212
    192213        /**
     214         * Prints extra scripts of a registered script.
    193215         *
    194216         * @since 3.3.0
    195217         * @access public
    196218         *
    197          * @param string $handle
    198          * @param bool   $echo
    199          * @return bool|string|void
     219         * @param string $handle The script's registered handle.
     220         * @param bool   $echo   Optional. Whether to echo the extra script instead of just returning it.
     221         *                       Default true.
     222         * @return bool|string|void Void if no data exists, extra scripts if `$echo` is true, true otherwise.
    200223         */
    201224        public function print_extra_script( $handle, $echo = true ) {
    202225                if ( !$output = $this->get_data( $handle, 'data' ) )
     
    215238        }
    216239
    217240        /**
     241         * Processes a script dependency.
    218242         *
    219243         * @since 2.6.0
    220244         * @since 2.8.0 Added the `$group` parameter.
    221245         * @access public
    222246         *
    223          * @param string   $handle Name of the item. Should be unique.
    224          * @param int|bool $group
    225          * @return bool True on success, false if not set.
     247         * @see WP_Dependencies::do_item()
     248         *
     249         * @param string $handle    The script's registered handle.
     250         * @param int|false $group  Optional. Group level: (int) level, (false) no groups. Default false.
     251         * @return bool True on success, false on failure.
    226252         */
    227253        public function do_item( $handle, $group = false ) {
    228254                if ( !parent::do_item($handle) )
     
    446472        }
    447473
    448474        /**
     475         * Sets handle group.
    449476         *
    450477         * @since 2.8.0
    451478         * @access public
    452479         *
    453          * @param string $handle    Name of the item. Should be unique.
    454          * @param bool   $recursion Internal flag that calling function was called recursively.
    455          * @param mixed  $group     Group level.
     480         * @see WP_Dependencies::set_group()
     481         *
     482         * @param string    $handle    Name of the item. Should be unique.
     483         * @param bool      $recursion Internal flag that calling function was called recursively.
     484         * @param int|false $group     Optional. Group level: (int) level, (false) no groups. Default false.
    456485         * @return bool Not already in the group or a lower group
    457486         */
    458487        public function set_group( $handle, $recursion, $group = false ) {
     
    468497        }
    469498
    470499        /**
    471          *
     500         * Determines script dependencies.
     501     *
    472502         * @since 2.1.0
    473503         * @access public
    474504         *
    475          * @param mixed $handles   Item handle and argument (string) or item handles and arguments (array of strings).
    476          * @param bool  $recursion Internal flag that function is calling itself.
    477          * @param mixed $group     Group level: (int) level, (false) no groups.
     505         * @see WP_Dependencies::all_deps()
     506         *
     507         * @param mixed     $handles   Item handle and argument (string) or item handles and arguments (array of strings).
     508         * @param bool      $recursion Internal flag that function is calling itself.
     509         * @param int|false $group     Optional. Group level: (int) level, (false) no groups. Default false.
    478510         * @return bool True on success, false on failure.
    479511         */
    480512        public function all_deps( $handles, $recursion = false, $group = false ) {
     
    493525        }
    494526
    495527        /**
     528         * Processes items and dependencies for the head group.
    496529         *
    497530         * @since 2.8.0
    498531         * @access public
    499532         *
    500          * @return array
     533         * @see WP_Dependencies::do_items()
     534         *
     535         * @return array Handles of items that have been processed.
    501536         */
    502537        public function do_head_items() {
    503538                $this->do_items(false, 0);
     
    505540        }
    506541
    507542        /**
     543         * Processes items and dependencies for the footer group.
    508544         *
    509545         * @since 2.8.0
    510546         * @access public
    511547         *
    512          * @return array
     548         * @see WP_Dependencies::do_items()
     549         *
     550         * @return array Handles of items that have been processed.
    513551         */
    514552        public function do_footer_items() {
    515553                $this->do_items(false, 1);
     
    517555        }
    518556
    519557        /**
     558         * Whether a handle's source is in a default directory.
    520559         *
    521560         * @since 2.8.0
    522561         * @access public
    523562         *
    524          * @param string $src
    525          * @return bool
     563         * @param string $src The source of the enqueued script.
     564         * @return bool True if found, false if not.
    526565         */
    527566        public function in_default_dir( $src ) {
    528567                if ( ! $this->default_dirs ) {
     
    542581        }
    543582
    544583        /**
     584         * Resets class properties.
    545585         *
    546586         * @since 2.8.0
    547587         * @access public
  • src/wp-includes/class.wp-styles.php

     
    2929        public $base_url;
    3030
    3131        /**
     32         * URL of the content URL.
    3233         *
     34         * Usually the value of `WP_CONTENT_URL`.
     35         *
    3336         * @since 2.8.0
    3437         * @access public
    3538         * @var string
     
    3740        public $content_url;
    3841
    3942        /**
     43         * Default version string for stylesheets.
    4044         *
     45         * Usually the value of `get_bloginfo( 'version' )`.
     46         *
    4147         * @since 2.6.0
    4248         * @access public
    4349         * @var string
     
    4551        public $default_version;
    4652
    4753        /**
     54         * The current text direction.
    4855         *
    4956         * @since 2.6.0
    5057         * @access public
     
    5360        public $text_direction = 'ltr';
    5461
    5562        /**
     63         * Holds list of style handles which will be concatenated.
    5664         *
    5765         * @since 2.8.0
    5866         * @access public
     
    6169        public $concat = '';
    6270
    6371        /**
     72         * Holds a string which contains style handles and their version.
    6473         *
    6574         * @since 2.8.0
     75         * @deprecated 3.4.0
    6676         * @access public
    6777         * @var string
    6878         */
    6979        public $concat_version = '';
    7080
    7181        /**
     82         * Whether to perform concatenation.
    7283         *
    7384         * @since 2.8.0
    7485         * @access public
     
    7788        public $do_concat = false;
    7889
    7990        /**
     91         * Holds HTML markup of scripts and additional data if concatenation
     92         * is enabled.
    8093         *
    8194         * @since 2.8.0
    8295         * @access public
     
    8598        public $print_html = '';
    8699
    87100        /**
     101         * Holds inline styles if concatenation is enabled.
    88102         *
    89103         * @since 3.3.0
    90104         * @access public
     
    93107        public $print_code = '';
    94108
    95109        /**
     110         * List of default directories.
    96111         *
    97112         * @since 2.8.0
    98113         * @access public
     
    118133        }
    119134
    120135        /**
     136         * Processes a style dependency.
    121137         *
    122138         * @since 2.6.0
    123139         * @access public
    124140         *
    125          * @param string $handle
    126          * @return bool
     141         * @see WP_Dependencies::do_item()
     142         *
     143         * @param string $handle The style's registered handle.
     144         * @return bool True on success, false on failure.
    127145         */
    128146        public function do_item( $handle ) {
    129147                if ( !parent::do_item($handle) )
     
    230248        }
    231249
    232250        /**
     251         * Add extra CSS styles to a registered stylesheet.
    233252         *
    234253         * @since 3.3.0
    235254         * @access public
    236255         *
    237          * @param string $handle
    238          * @param string $code
     256         * @param string $handle The style's registered handle.
     257         * @param string $code   String containing the CSS styles to be added.
     258         * @return bool True on success, false on failure.
    239259         */
    240260        public function add_inline_style( $handle, $code ) {
    241261                if ( ! $code ) {
     
    253273        }
    254274
    255275        /**
     276         * Prints extra CSS styles of a registered stylesheet.
    256277         *
    257278         * @since 3.3.0
    258279         * @access public
    259280         *
    260          * @param string $handle
    261          * @param bool $echo
    262          * @return bool
     281         * @param string $handle The style's registered handle.
     282         * @param bool   $echo   Optional. Whether to echo the inline style instead of just returning it.
     283         *                       Default true.
     284         * @return string|bool   False if no data exists, inline styles if `$echo` is true, true otherwise.
    263285         */
    264286        public function print_inline_style( $handle, $echo = true ) {
    265287                $output = $this->get_data( $handle, 'after' );
     
    280302        }
    281303
    282304        /**
     305         * Determines style dependencies.
    283306         *
    284307         * @since 2.6.0
    285308         * @access public
    286309         *
    287          * @param mixed $handles
    288          * @param bool $recursion
    289          * @param mixed $group
    290          * @return bool
     310         * @see WP_Dependencies::all_deps()
     311         *
     312         * @param mixed     $handles   Item handle and argument (string) or item handles and arguments (array of strings).
     313         * @param bool      $recursion Internal flag that function is calling itself.
     314         * @param int|false $group     Group level: (int) level, (false) no groups.
     315         * @return bool True on success, false on failure.
    291316         */
    292317        public function all_deps( $handles, $recursion = false, $group = false ) {
    293318                $r = parent::all_deps( $handles, $recursion );
    294                 if ( !$recursion ) {
     319                if ( ! $recursion ) {
    295320                        /**
    296321                         * Filter the array of enqueued styles before processing for output.
    297322                         *
     
    305330        }
    306331
    307332        /**
     333         * Generates an enqueued style's fully-qualified URL.
    308334         *
    309335         * @since 2.6.0
    310336         * @access public
    311337         *
    312          * @param string $src
    313          * @param string $ver
    314          * @param string $handle
     338         * @param string $src The source of the enqueued style.
     339         * @param string $ver The version of the enqueued style.
     340         * @param string $handle The style's registered handle.
    315341         * @return string
    316342         */
    317343        public function _css_href( $src, $ver, $handle ) {
     
    335361        }
    336362
    337363        /**
     364         * Whether a handle's source is in a default directory.
    338365         *
    339366         * @since 2.8.0
    340367         * @access public
    341368         *
    342          * @param string $src
    343          * @return bool
     369         * @param string $src The source of the enqueued style.
     370         * @return bool True if found, false if not.
    344371         */
    345372        public function in_default_dir( $src ) {
    346373                if ( ! $this->default_dirs )
     
    354381        }
    355382
    356383        /**
     384         * Processes items and dependencies for the footer group.
    357385         *
    358386         * HTML 5 allows styles in the body, grab late enqueued items and output them in the footer.
    359387         *
    360388         * @since 3.3.0
    361389         * @access public
    362390         *
    363          * @return array
     391         * @see WP_Dependencies::do_items()
     392         *
     393         * @return array Handles of items that have been processed.
    364394         */
    365395        public function do_footer_items() {
    366396                $this->do_items(false, 1);
     
    368398        }
    369399
    370400        /**
     401         * Resets class properties.
    371402         *
    372403         * @since 3.3.0
    373404         * @access public