@@ -113,8 +113,6 @@ public function __construct( WP_Customize_Manager $manager ) {
113
113
);
114
114
$ this ->sanitize_meta_filters = apply_filters ( 'wp_customize_posts_sanitize_meta_filters ' , $ this ->sanitize_meta_filters );
115
115
116
- add_action ( 'wp_default_scripts ' , array ( $ this , 'register_scripts ' ) );
117
- add_action ( 'wp_default_styles ' , array ( $ this , 'register_styles ' ) );
118
116
add_action ( 'customize_controls_enqueue_scripts ' , array ( $ this , 'enqueue_scripts ' ) );
119
117
add_action ( 'customize_controls_enqueue_scripts ' , array ( $ this , 'export_panel_data ' ) );
120
118
add_action ( 'customize_controls_print_footer_scripts ' , array ( 'WP_Post_Edit_Customize_Control ' , 'render_templates ' ) );
@@ -274,32 +272,26 @@ public function current_user_can_edit_post_meta( $post, $key, $value = '' ) {
274
272
275
273
/**
276
274
* Register scripts for Customize Posts.
277
- *
278
- * Fires after wp_default_scripts
279
- *
280
- * @param WP_Scripts $scripts
281
275
*/
282
- public function register_scripts ( & $ scripts ) {
283
- $ scripts -> add ( 'customize-base-extensions ' , CUSTOMIZE_POSTS_PLUGIN_URL . 'js/customize-base-extensions.js ' , array ( 'customize-base ' ), false , 1 );
284
- $ scripts -> add ( 'customize-posts ' , CUSTOMIZE_POSTS_PLUGIN_URL . 'js/customize-posts.js ' , array ( 'jquery ' , 'wp-backbone ' , 'customize-base-extensions ' , 'customize-controls ' , 'underscore ' ), false , 1 );
285
- $ scripts -> add ( 'customize-preview-posts ' , CUSTOMIZE_POSTS_PLUGIN_URL . 'js/customize-preview-posts.js ' , array ( 'jquery ' , 'customize-preview ' ), false , 1 );
276
+ public function register_scripts () {
277
+ wp_register_script ( 'customize-base-extensions ' , CUSTOMIZE_POSTS_PLUGIN_URL . 'js/customize-base-extensions.js ' , array ( 'customize-base ' ), false , 1 );
278
+ wp_register_script ( 'customize-posts ' , CUSTOMIZE_POSTS_PLUGIN_URL . 'js/customize-posts.js ' , array ( 'jquery ' , 'wp-backbone ' , 'customize-base-extensions ' , 'customize-controls ' , 'underscore ' ), false , 1 );
279
+ wp_register_script ( 'customize-preview-posts ' , CUSTOMIZE_POSTS_PLUGIN_URL . 'js/customize-preview-posts.js ' , array ( 'jquery ' , 'customize-preview ' ), false , 1 );
286
280
}
287
281
288
282
/**
289
283
* Register styles for Customize Posts.
290
- *
291
- * Fires after wp_default_styles
292
- *
293
- * @param WP_Styles $styles
294
284
*/
295
- public function register_styles ( & $ styles ) {
296
- $ styles -> add ( 'customize-posts-style ' , CUSTOMIZE_POSTS_PLUGIN_URL . 'css/customize-posts.css ' , array ( 'wp-admin ' ) );
285
+ public function register_styles () {
286
+ wp_register_style ( 'customize-posts-style ' , CUSTOMIZE_POSTS_PLUGIN_URL . 'css/customize-posts.css ' , array ( 'wp-admin ' ) );
297
287
}
298
288
299
289
/**
300
290
* Enqueue scripts and styles for Customize Posts.
301
291
*/
302
292
public function enqueue_scripts () {
293
+ $ this ->register_scripts ();
294
+ $ this ->register_styles ();
303
295
wp_enqueue_script ( 'customize-posts ' );
304
296
wp_enqueue_style ( 'customize-posts-style ' );
305
297
}
0 commit comments