Add missing access modifiers to methods in `WP_Scripts` and `WP_Styles`.

See #27881, #22234.

Built from https://develop.svn.wordpress.org/trunk@28518


git-svn-id: http://core.svn.wordpress.org/trunk@28344 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-05-19 06:17:14 +00:00
parent f998ac39d3
commit 5030fdef62
2 changed files with 44 additions and 44 deletions

View File

@ -17,25 +17,25 @@
* @since r16
*/
class WP_Scripts extends WP_Dependencies {
var $base_url; // Full URL with trailing slash
var $content_url;
var $default_version;
var $in_footer = array();
var $concat = '';
var $concat_version = '';
var $do_concat = false;
var $print_html = '';
var $print_code = '';
var $ext_handles = '';
var $ext_version = '';
var $default_dirs;
public $base_url; // Full URL with trailing slash
public $content_url;
public $default_version;
public $in_footer = array();
public $concat = '';
public $concat_version = '';
public $do_concat = false;
public $print_html = '';
public $print_code = '';
public $ext_handles = '';
public $ext_version = '';
public $default_dirs;
function __construct() {
public function __construct() {
$this->init();
add_action( 'init', array( $this, 'init' ), 0 );
}
function init() {
public function init() {
/**
* Fires when the WP_Scripts instance is initialized.
*
@ -55,17 +55,17 @@ class WP_Scripts extends WP_Dependencies {
* @param int $group (optional) If scripts were queued in groups prints this group number.
* @return array Scripts that have been printed
*/
function print_scripts( $handles = false, $group = false ) {
public function print_scripts( $handles = false, $group = false ) {
return $this->do_items( $handles, $group );
}
// Deprecated since 3.3, see print_extra_script()
function print_scripts_l10n( $handle, $echo = true ) {
public function print_scripts_l10n( $handle, $echo = true ) {
_deprecated_function( __FUNCTION__, '3.3', 'print_extra_script()' );
return $this->print_extra_script( $handle, $echo );
}
function print_extra_script( $handle, $echo = true ) {
public function print_extra_script( $handle, $echo = true ) {
if ( !$output = $this->get_data( $handle, 'data' ) )
return;
@ -81,7 +81,7 @@ class WP_Scripts extends WP_Dependencies {
return true;
}
function do_item( $handle, $group = false ) {
public function do_item( $handle, $group = false ) {
if ( !parent::do_item($handle) )
return false;
@ -151,7 +151,7 @@ class WP_Scripts extends WP_Dependencies {
*
* Localizes only if the script has already been added
*/
function localize( $handle, $object_name, $l10n ) {
public function localize( $handle, $object_name, $l10n ) {
if ( $handle === 'jquery' )
$handle = 'jquery-core';
@ -180,7 +180,7 @@ class WP_Scripts extends WP_Dependencies {
return $this->add_data( $handle, 'data', $script );
}
function set_group( $handle, $recursion, $group = false ) {
public function set_group( $handle, $recursion, $group = false ) {
if ( $this->registered[$handle]->args === 1 )
$grp = 1;
@ -193,7 +193,7 @@ class WP_Scripts extends WP_Dependencies {
return parent::set_group( $handle, $recursion, $grp );
}
function all_deps( $handles, $recursion = false, $group = false ) {
public function all_deps( $handles, $recursion = false, $group = false ) {
$r = parent::all_deps( $handles, $recursion );
if ( ! $recursion ) {
/**
@ -208,17 +208,17 @@ class WP_Scripts extends WP_Dependencies {
return $r;
}
function do_head_items() {
public function do_head_items() {
$this->do_items(false, 0);
return $this->done;
}
function do_footer_items() {
public function do_footer_items() {
$this->do_items(false, 1);
return $this->done;
}
function in_default_dir($src) {
public function in_default_dir($src) {
if ( ! $this->default_dirs )
return true;
@ -232,7 +232,7 @@ class WP_Scripts extends WP_Dependencies {
return false;
}
function reset() {
public function reset() {
$this->do_concat = false;
$this->print_code = '';
$this->concat = '';

View File

@ -17,18 +17,18 @@
* @since r74
*/
class WP_Styles extends WP_Dependencies {
var $base_url;
var $content_url;
var $default_version;
var $text_direction = 'ltr';
var $concat = '';
var $concat_version = '';
var $do_concat = false;
var $print_html = '';
var $print_code = '';
var $default_dirs;
public $base_url;
public $content_url;
public $default_version;
public $text_direction = 'ltr';
public $concat = '';
public $concat_version = '';
public $do_concat = false;
public $print_html = '';
public $print_code = '';
public $default_dirs;
function __construct() {
public function __construct() {
/**
* Fires when the WP_Styles instance is initialized.
*
@ -39,7 +39,7 @@ class WP_Styles extends WP_Dependencies {
do_action_ref_array( 'wp_default_styles', array(&$this) );
}
function do_item( $handle ) {
public function do_item( $handle ) {
if ( !parent::do_item($handle) )
return false;
@ -119,7 +119,7 @@ class WP_Styles extends WP_Dependencies {
return true;
}
function add_inline_style( $handle, $code ) {
public function add_inline_style( $handle, $code ) {
if ( !$code )
return false;
@ -132,7 +132,7 @@ class WP_Styles extends WP_Dependencies {
return $this->add_data( $handle, 'after', $after );
}
function print_inline_style( $handle, $echo = true ) {
public function print_inline_style( $handle, $echo = true ) {
$output = $this->get_data( $handle, 'after' );
if ( empty( $output ) )
@ -150,7 +150,7 @@ class WP_Styles extends WP_Dependencies {
return true;
}
function all_deps( $handles, $recursion = false, $group = false ) {
public function all_deps( $handles, $recursion = false, $group = false ) {
$r = parent::all_deps( $handles, $recursion );
if ( !$recursion ) {
/**
@ -165,7 +165,7 @@ class WP_Styles extends WP_Dependencies {
return $r;
}
function _css_href( $src, $ver, $handle ) {
public function _css_href( $src, $ver, $handle ) {
if ( !is_bool($src) && !preg_match('|^(https?:)?//|', $src) && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) {
$src = $this->base_url . $src;
}
@ -185,7 +185,7 @@ class WP_Styles extends WP_Dependencies {
return esc_url( $src );
}
function in_default_dir($src) {
public function in_default_dir($src) {
if ( ! $this->default_dirs )
return true;
@ -196,12 +196,12 @@ class WP_Styles extends WP_Dependencies {
return false;
}
function do_footer_items() { // HTML 5 allows styles in the body, grab late enqueued items and output them in the footer.
public function do_footer_items() { // HTML 5 allows styles in the body, grab late enqueued items and output them in the footer.
$this->do_items(false, 1);
return $this->done;
}
function reset() {
public function reset() {
$this->do_concat = false;
$this->concat = '';
$this->concat_version = '';