Ticket #20507: 20507.2.diff
File 20507.2.diff, 5.7 KB (added by , 13 years ago) |
---|
-
wp-includes/class-wp-customize.php
27 27 * @since 3.4.0 28 28 */ 29 29 public function __construct() { 30 require( ABSPATH . 'wp-admin/includes/admin.php' ); 30 31 require( ABSPATH . WPINC . '/class-wp-customize-setting.php' ); 31 32 require( ABSPATH . WPINC . '/class-wp-customize-section.php' ); 32 33 require( ABSPATH . WPINC . '/class-wp-customize-control.php' ); 33 34 34 35 add_action( 'setup_theme', array( $this, 'setup_theme' ) ); 35 add_action( 'admin_init', array( $this, 'admin_init' ) );36 36 add_action( 'wp_loaded', array( $this, 'wp_loaded' ) ); 37 37 38 38 add_action( 'wp_ajax_customize_save', array( $this, 'save' ) ); … … 150 150 public function wp_loaded() { 151 151 do_action( 'customize_register', $this ); 152 152 153 $this->maybe_load_controls(); 154 153 155 if ( $this->is_preview() && ! is_admin() ) 154 156 $this->customize_preview_init(); 155 157 } … … 286 288 } 287 289 288 290 /** 289 * Trigger save action andload customize controls.291 * Potentially load customize controls. 290 292 * 291 293 * @since 3.4.0 292 294 */ 293 public function admin_init() {295 public function maybe_load_controls() { 294 296 if ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) 295 297 return; 296 298 -
wp-includes/theme.php
1340 1340 * @access private 1341 1341 */ 1342 1342 function _custom_header_background_just_in_time() { 1343 global $custom_image_header, $custom_background;1344 1345 1343 if ( current_theme_supports( 'custom-header' ) ) { 1346 1344 // In case any constants were defined after an add_custom_image_header() call, re-run. 1347 1345 add_theme_support( 'custom-header', array( '__jit' => true ) ); … … 1349 1347 $args = get_theme_support( 'custom-header' ); 1350 1348 if ( $args[0]['wp-head-callback'] && $args[0]['admin-head-callback'] ) { 1351 1349 add_action( 'wp_head', $args[0]['wp-head-callback'] ); 1352 1353 if ( is_admin() ) { 1354 require_once( ABSPATH . 'wp-admin/custom-header.php' ); 1355 $custom_image_header = new Custom_Image_Header( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] ); 1356 } 1350 add_action( 'admin_init', '_custom_header_background_load_admin' ); 1357 1351 } 1358 1352 } 1359 1353 … … 1363 1357 1364 1358 $args = get_theme_support( 'custom-background' ); 1365 1359 add_action( 'wp_head', $args[0]['wp-head-callback'] ); 1366 1367 if ( is_admin() ) { 1368 require_once( ABSPATH . 'wp-admin/custom-background.php' ); 1369 $custom_background = new Custom_Background( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] ); 1370 } 1360 add_action( 'admin_init', '_custom_header_background_load_admin' ); 1371 1361 } 1372 1362 } 1373 1363 add_action( 'wp_loaded', '_custom_header_background_just_in_time' ); 1374 1364 1375 1365 /** 1366 * Loads the internal custom header and background routines. 1367 * 1368 * @since 3.4.0 1369 * @access private 1370 */ 1371 function _custom_header_background_load_admin() { 1372 global $custom_image_header, $custom_background; 1373 if ( current_theme_supports( 'custom-header' ) ) { 1374 $args = get_theme_support( 'custom-header' ); 1375 require_once( ABSPATH . 'wp-admin/custom-header.php' ); 1376 $custom_image_header = new Custom_Image_Header( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] ); 1377 } 1378 if ( current_theme_supports( 'custom-background' ) ) { 1379 $args = get_theme_support( 'custom-background' ); 1380 require_once( ABSPATH . 'wp-admin/custom-background.php' ); 1381 $custom_background = new Custom_Background( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] ); 1382 } 1383 } 1384 1385 /** 1376 1386 * Gets the theme support arguments passed when registering that support 1377 1387 * 1378 1388 * @since 3.1 … … 1604 1614 * @since 3.4.0 1605 1615 */ 1606 1616 function wp_customize_url( $stylesheet ) { 1607 return esc_url( admin_url( 'admin.php' ) . '?customize=on&theme=' . $stylesheet);1617 return esc_url( home_url( '?customize=on&theme=' . $stylesheet ) ); 1608 1618 } 1619 No newline at end of file -
wp-includes/customize-controls.php
10 10 if ( ! defined( 'ABSPATH' ) ) 11 11 die; 12 12 13 global $wp_scripts; 13 do_action( 'admin_init' ); // To register the color schemes and possibly other things, who knows. 14 14 15 if ( empty ( $wp_scripts ) ) { 16 $wp_scripts = new WP_Scripts; 17 } else { 18 $registered = $wp_scripts->registered; 19 $wp_scripts = new WP_Scripts; 20 $wp_scripts->registered = $registered; 21 } 22 15 23 $registered = $wp_scripts->registered; 16 24 $wp_scripts = new WP_Scripts; 17 25 $wp_scripts->registered = $registered; -
wp-includes/script-loader.php
302 302 $scripts->add( 'customize-controls', "/wp-includes/js/customize-controls$suffix.js", array( 'customize-base' ), false, 1 ); 303 303 $scripts->add( 'customize-preview', "/wp-includes/js/customize-preview$suffix.js", array( 'customize-base' ), false, 1 ); 304 304 305 $scripts->add( 'farbtastic', '/wp-admin/js/farbtastic.js', array('jquery'), '1.2' ); 306 305 307 if ( is_admin() ) { 306 308 $scripts->add( 'ajaxcat', "/wp-admin/js/cat$suffix.js", array( 'wp-lists' ) ); 307 309 $scripts->add_data( 'ajaxcat', 'group', 1 ); … … 391 393 'ays' => __('Are you sure you want to install this plugin?') 392 394 ) ); 393 395 394 $scripts->add( 'farbtastic', '/wp-admin/js/farbtastic.js', array('jquery'), '1.2' );395 396 396 $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), false, 1 ); 397 397 398 398 $scripts->add( 'list-revisions', "/wp-includes/js/wp-list-revisions$suffix.js" );