Changeset 28518
- Timestamp:
- 05/19/2014 06:16:39 AM (10 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class.wp-scripts.php
r27731 r28518 18 18 */ 19 19 class WP_Scripts extends WP_Dependencies { 20 var$base_url; // Full URL with trailing slash21 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() { 34 34 $this->init(); 35 35 add_action( 'init', array( $this, 'init' ), 0 ); 36 36 } 37 37 38 function init() {38 public function init() { 39 39 /** 40 40 * Fires when the WP_Scripts instance is initialized. … … 56 56 * @return array Scripts that have been printed 57 57 */ 58 function print_scripts( $handles = false, $group = false ) {58 public function print_scripts( $handles = false, $group = false ) { 59 59 return $this->do_items( $handles, $group ); 60 60 } 61 61 62 62 // 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 ) { 64 64 _deprecated_function( __FUNCTION__, '3.3', 'print_extra_script()' ); 65 65 return $this->print_extra_script( $handle, $echo ); 66 66 } 67 67 68 function print_extra_script( $handle, $echo = true ) {68 public function print_extra_script( $handle, $echo = true ) { 69 69 if ( !$output = $this->get_data( $handle, 'data' ) ) 70 70 return; … … 82 82 } 83 83 84 function do_item( $handle, $group = false ) {84 public function do_item( $handle, $group = false ) { 85 85 if ( !parent::do_item($handle) ) 86 86 return false; … … 152 152 * Localizes only if the script has already been added 153 153 */ 154 function localize( $handle, $object_name, $l10n ) {154 public function localize( $handle, $object_name, $l10n ) { 155 155 if ( $handle === 'jquery' ) 156 156 $handle = 'jquery-core'; … … 181 181 } 182 182 183 function set_group( $handle, $recursion, $group = false ) {183 public function set_group( $handle, $recursion, $group = false ) { 184 184 185 185 if ( $this->registered[$handle]->args === 1 ) … … 194 194 } 195 195 196 function all_deps( $handles, $recursion = false, $group = false ) {196 public function all_deps( $handles, $recursion = false, $group = false ) { 197 197 $r = parent::all_deps( $handles, $recursion ); 198 198 if ( ! $recursion ) { … … 209 209 } 210 210 211 function do_head_items() {211 public function do_head_items() { 212 212 $this->do_items(false, 0); 213 213 return $this->done; 214 214 } 215 215 216 function do_footer_items() {216 public function do_footer_items() { 217 217 $this->do_items(false, 1); 218 218 return $this->done; 219 219 } 220 220 221 function in_default_dir($src) {221 public function in_default_dir($src) { 222 222 if ( ! $this->default_dirs ) 223 223 return true; … … 233 233 } 234 234 235 function reset() {235 public function reset() { 236 236 $this->do_concat = false; 237 237 $this->print_code = ''; -
trunk/src/wp-includes/class.wp-styles.php
r28209 r28518 18 18 */ 19 19 class 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() { 32 32 /** 33 33 * Fires when the WP_Styles instance is initialized. … … 40 40 } 41 41 42 function do_item( $handle ) {42 public function do_item( $handle ) { 43 43 if ( !parent::do_item($handle) ) 44 44 return false; … … 120 120 } 121 121 122 function add_inline_style( $handle, $code ) {122 public function add_inline_style( $handle, $code ) { 123 123 if ( !$code ) 124 124 return false; … … 133 133 } 134 134 135 function print_inline_style( $handle, $echo = true ) {135 public function print_inline_style( $handle, $echo = true ) { 136 136 $output = $this->get_data( $handle, 'after' ); 137 137 … … 151 151 } 152 152 153 function all_deps( $handles, $recursion = false, $group = false ) {153 public function all_deps( $handles, $recursion = false, $group = false ) { 154 154 $r = parent::all_deps( $handles, $recursion ); 155 155 if ( !$recursion ) { … … 166 166 } 167 167 168 function _css_href( $src, $ver, $handle ) {168 public function _css_href( $src, $ver, $handle ) { 169 169 if ( !is_bool($src) && !preg_match('|^(https?:)?//|', $src) && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) { 170 170 $src = $this->base_url . $src; … … 186 186 } 187 187 188 function in_default_dir($src) {188 public function in_default_dir($src) { 189 189 if ( ! $this->default_dirs ) 190 190 return true; … … 197 197 } 198 198 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. 200 200 $this->do_items(false, 1); 201 201 return $this->done; 202 202 } 203 203 204 function reset() {204 public function reset() { 205 205 $this->do_concat = false; 206 206 $this->concat = '';
Note: See TracChangeset
for help on using the changeset viewer.