Add missing access modifiers to methods in WP_Scripts
and WP_Styles
.
See #27881, #22234. git-svn-id: https://develop.svn.wordpress.org/trunk@28518 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
bd478a0135
commit
ce917f0bc4
@ -17,25 +17,25 @@
|
|||||||
* @since r16
|
* @since r16
|
||||||
*/
|
*/
|
||||||
class WP_Scripts extends WP_Dependencies {
|
class WP_Scripts extends WP_Dependencies {
|
||||||
var $base_url; // Full URL with trailing slash
|
public $base_url; // Full URL with trailing slash
|
||||||
var $content_url;
|
public $content_url;
|
||||||
var $default_version;
|
public $default_version;
|
||||||
var $in_footer = array();
|
public $in_footer = array();
|
||||||
var $concat = '';
|
public $concat = '';
|
||||||
var $concat_version = '';
|
public $concat_version = '';
|
||||||
var $do_concat = false;
|
public $do_concat = false;
|
||||||
var $print_html = '';
|
public $print_html = '';
|
||||||
var $print_code = '';
|
public $print_code = '';
|
||||||
var $ext_handles = '';
|
public $ext_handles = '';
|
||||||
var $ext_version = '';
|
public $ext_version = '';
|
||||||
var $default_dirs;
|
public $default_dirs;
|
||||||
|
|
||||||
function __construct() {
|
public function __construct() {
|
||||||
$this->init();
|
$this->init();
|
||||||
add_action( 'init', array( $this, 'init' ), 0 );
|
add_action( 'init', array( $this, 'init' ), 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
function init() {
|
public function init() {
|
||||||
/**
|
/**
|
||||||
* Fires when the WP_Scripts instance is initialized.
|
* 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.
|
* @param int $group (optional) If scripts were queued in groups prints this group number.
|
||||||
* @return array Scripts that have been printed
|
* @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 );
|
return $this->do_items( $handles, $group );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated since 3.3, see print_extra_script()
|
// 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()' );
|
_deprecated_function( __FUNCTION__, '3.3', 'print_extra_script()' );
|
||||||
return $this->print_extra_script( $handle, $echo );
|
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' ) )
|
if ( !$output = $this->get_data( $handle, 'data' ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ class WP_Scripts extends WP_Dependencies {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function do_item( $handle, $group = false ) {
|
public function do_item( $handle, $group = false ) {
|
||||||
if ( !parent::do_item($handle) )
|
if ( !parent::do_item($handle) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ class WP_Scripts extends WP_Dependencies {
|
|||||||
*
|
*
|
||||||
* Localizes only if the script has already been added
|
* 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' )
|
if ( $handle === 'jquery' )
|
||||||
$handle = 'jquery-core';
|
$handle = 'jquery-core';
|
||||||
|
|
||||||
@ -180,7 +180,7 @@ class WP_Scripts extends WP_Dependencies {
|
|||||||
return $this->add_data( $handle, 'data', $script );
|
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 )
|
if ( $this->registered[$handle]->args === 1 )
|
||||||
$grp = 1;
|
$grp = 1;
|
||||||
@ -193,7 +193,7 @@ class WP_Scripts extends WP_Dependencies {
|
|||||||
return parent::set_group( $handle, $recursion, $grp );
|
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 );
|
$r = parent::all_deps( $handles, $recursion );
|
||||||
if ( ! $recursion ) {
|
if ( ! $recursion ) {
|
||||||
/**
|
/**
|
||||||
@ -208,17 +208,17 @@ class WP_Scripts extends WP_Dependencies {
|
|||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
|
|
||||||
function do_head_items() {
|
public function do_head_items() {
|
||||||
$this->do_items(false, 0);
|
$this->do_items(false, 0);
|
||||||
return $this->done;
|
return $this->done;
|
||||||
}
|
}
|
||||||
|
|
||||||
function do_footer_items() {
|
public function do_footer_items() {
|
||||||
$this->do_items(false, 1);
|
$this->do_items(false, 1);
|
||||||
return $this->done;
|
return $this->done;
|
||||||
}
|
}
|
||||||
|
|
||||||
function in_default_dir($src) {
|
public function in_default_dir($src) {
|
||||||
if ( ! $this->default_dirs )
|
if ( ! $this->default_dirs )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@ -232,7 +232,7 @@ class WP_Scripts extends WP_Dependencies {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function reset() {
|
public function reset() {
|
||||||
$this->do_concat = false;
|
$this->do_concat = false;
|
||||||
$this->print_code = '';
|
$this->print_code = '';
|
||||||
$this->concat = '';
|
$this->concat = '';
|
||||||
|
@ -17,18 +17,18 @@
|
|||||||
* @since r74
|
* @since r74
|
||||||
*/
|
*/
|
||||||
class WP_Styles extends WP_Dependencies {
|
class WP_Styles extends WP_Dependencies {
|
||||||
var $base_url;
|
public $base_url;
|
||||||
var $content_url;
|
public $content_url;
|
||||||
var $default_version;
|
public $default_version;
|
||||||
var $text_direction = 'ltr';
|
public $text_direction = 'ltr';
|
||||||
var $concat = '';
|
public $concat = '';
|
||||||
var $concat_version = '';
|
public $concat_version = '';
|
||||||
var $do_concat = false;
|
public $do_concat = false;
|
||||||
var $print_html = '';
|
public $print_html = '';
|
||||||
var $print_code = '';
|
public $print_code = '';
|
||||||
var $default_dirs;
|
public $default_dirs;
|
||||||
|
|
||||||
function __construct() {
|
public function __construct() {
|
||||||
/**
|
/**
|
||||||
* Fires when the WP_Styles instance is initialized.
|
* 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) );
|
do_action_ref_array( 'wp_default_styles', array(&$this) );
|
||||||
}
|
}
|
||||||
|
|
||||||
function do_item( $handle ) {
|
public function do_item( $handle ) {
|
||||||
if ( !parent::do_item($handle) )
|
if ( !parent::do_item($handle) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ class WP_Styles extends WP_Dependencies {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function add_inline_style( $handle, $code ) {
|
public function add_inline_style( $handle, $code ) {
|
||||||
if ( !$code )
|
if ( !$code )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ class WP_Styles extends WP_Dependencies {
|
|||||||
return $this->add_data( $handle, 'after', $after );
|
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' );
|
$output = $this->get_data( $handle, 'after' );
|
||||||
|
|
||||||
if ( empty( $output ) )
|
if ( empty( $output ) )
|
||||||
@ -150,7 +150,7 @@ class WP_Styles extends WP_Dependencies {
|
|||||||
return true;
|
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 );
|
$r = parent::all_deps( $handles, $recursion );
|
||||||
if ( !$recursion ) {
|
if ( !$recursion ) {
|
||||||
/**
|
/**
|
||||||
@ -165,7 +165,7 @@ class WP_Styles extends WP_Dependencies {
|
|||||||
return $r;
|
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) ) ) {
|
if ( !is_bool($src) && !preg_match('|^(https?:)?//|', $src) && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) {
|
||||||
$src = $this->base_url . $src;
|
$src = $this->base_url . $src;
|
||||||
}
|
}
|
||||||
@ -185,7 +185,7 @@ class WP_Styles extends WP_Dependencies {
|
|||||||
return esc_url( $src );
|
return esc_url( $src );
|
||||||
}
|
}
|
||||||
|
|
||||||
function in_default_dir($src) {
|
public function in_default_dir($src) {
|
||||||
if ( ! $this->default_dirs )
|
if ( ! $this->default_dirs )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@ -196,12 +196,12 @@ class WP_Styles extends WP_Dependencies {
|
|||||||
return false;
|
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);
|
$this->do_items(false, 1);
|
||||||
return $this->done;
|
return $this->done;
|
||||||
}
|
}
|
||||||
|
|
||||||
function reset() {
|
public function reset() {
|
||||||
$this->do_concat = false;
|
$this->do_concat = false;
|
||||||
$this->concat = '';
|
$this->concat = '';
|
||||||
$this->concat_version = '';
|
$this->concat_version = '';
|
||||||
|
Loading…
Reference in New Issue
Block a user