Skip to content

Commit 832024b

Browse files
committed
refactor: Update settings API dependencies
- Update settings API to use WordPress core color picker and tabs - Improve media selector with proper WordPress media dependencies
1 parent cb89b51 commit 832024b

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

includes/admin/settings/class-settings-api.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ public function admin_enqueue_scripts( $hook ) {
483483
wp_register_script(
484484
'wz-' . $this->prefix . '-admin',
485485
plugins_url( 'js/settings-admin-scripts' . $minimize . '.js', __FILE__ ),
486-
array( 'jquery' ),
486+
array( 'jquery', 'wp-color-picker', 'jquery-ui-tabs' ),
487487
self::VERSION,
488488
true
489489
);
@@ -497,14 +497,14 @@ public function admin_enqueue_scripts( $hook ) {
497497
wp_register_script(
498498
'wz-' . $this->prefix . '-media-selector',
499499
plugins_url( 'js/media-selector' . $minimize . '.js', __FILE__ ),
500-
array( 'jquery' ),
500+
array( 'jquery', 'media-editor', 'media-views' ),
501501
self::VERSION,
502502
true
503503
);
504504
wp_register_style(
505505
'wz-' . $this->prefix . '-admin',
506506
plugins_url( 'css/admin-style' . $minimize . '.css', __FILE__ ),
507-
array(),
507+
array( 'wp-color-picker' ),
508508
self::VERSION
509509
);
510510

@@ -556,13 +556,7 @@ public function admin_enqueue_scripts( $hook ) {
556556
*/
557557
public static function enqueue_scripts_styles( $prefix, $args = array() ) {
558558

559-
wp_enqueue_style( 'wp-color-picker' );
560-
561559
wp_enqueue_media();
562-
wp_enqueue_script( 'wp-color-picker' );
563-
wp_enqueue_script( 'jquery' );
564-
wp_enqueue_script( 'jquery-ui-autocomplete' );
565-
wp_enqueue_script( 'jquery-ui-tabs' );
566560

567561
wp_enqueue_code_editor(
568562
array(

0 commit comments

Comments
 (0)