|
9 | 9 | * ----------------------------------- |
10 | 10 | * DEVELOPED-MAINTAINED-SUPPPORTED BY |
11 | 11 | * ----------------------------------- |
12 | | - * ███ ███╗ ████████████████ |
13 | | - * ███ ███║ ██████ |
14 | | - * ███ ███║ ╔══█████ |
15 | | - * ████████████║ ╚█████ |
16 | | - * ███║ ███║ █████ |
17 | | - * ███║ ███║ █████ |
| 12 | + * ███║ ███╗ ████████████████ |
| 13 | + * ███║ ███║ ═════════██████╗ |
| 14 | + * ███║ ███║ ╔══█████═╝ |
| 15 | + * ████████████║ ╚═█████ |
| 16 | + * ███║═════███║ █████╗ |
| 17 | + * ███║ ███║ █████═╝ |
18 | 18 | * ███║ ███║ ████████████████╗ |
19 | | - * ╚═╝ ╚═╝ ════════════════╝ |
| 19 | + * ╚═╝ ╚═╝ ═══════════════╝ |
20 | 20 | */ |
21 | 21 |
|
22 | 22 | namespace TheWebSolver\Plugin\Core\Framework; |
@@ -421,21 +421,38 @@ public function set_capability( $cap ) { |
421 | 421 | */ |
422 | 422 | public function load_assets() { |
423 | 423 |
|
| 424 | + /** |
| 425 | + * WPHOOK: Action -> After loading of each submenu page |
| 426 | + * |
| 427 | + * This hook can only be accessed on pages created by child-class |
| 428 | + */ |
| 429 | + do_action( 'hzfex_setting_framework_page_loaded' ); |
| 430 | + |
| 431 | + // enqueues styles and scripts. |
| 432 | + add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_scripts' ] ); |
| 433 | + |
| 434 | + } |
| 435 | + |
| 436 | + /** |
| 437 | + * Enqueues styles and scripts |
| 438 | + * |
| 439 | + * @return void |
| 440 | + * |
| 441 | + * @since 1.0 |
| 442 | + * |
| 443 | + * @access public |
| 444 | + */ |
| 445 | + public function enqueue_scripts() { |
| 446 | + |
424 | 447 | // core style/script |
425 | 448 | wp_enqueue_style( 'wp-color-picker' ); |
426 | 449 | wp_enqueue_media(); |
| 450 | + wp_enqueue_script( 'wp-color-picker' ); |
427 | 451 | wp_enqueue_script( 'jquery' ); |
428 | 452 |
|
429 | 453 | // enqueue setting page stylesheet. |
430 | 454 | wp_enqueue_style( 'hzfex_setting_page_style' ); |
431 | 455 |
|
432 | | - /** |
433 | | - * WPHOOK: Action -> After loading of each submenu page |
434 | | - * |
435 | | - * This hook can only be accessed on pages created by child-class |
436 | | - */ |
437 | | - do_action( 'hzfex_setting_framework_page_loaded' ); |
438 | | - |
439 | 456 | } |
440 | 457 |
|
441 | 458 | /** |
@@ -466,13 +483,13 @@ public function load_sections() { |
466 | 483 | if( ! is_array( $sections ) ) die( $this->section_die() ); |
467 | 484 |
|
468 | 485 | /** |
469 | | - * WPHOOK: Filter -> display section navigation if page has single section? |
| 486 | + * WPHOOK: Filter -> display section tabs if page has single section? |
470 | 487 | * |
471 | | - * Controls whether or not to show nav if page has only one section. |
| 488 | + * Controls whether or not to show section tabs if page has only one section. |
472 | 489 | * |
473 | 490 | * @example - usage: |
474 | 491 | * |
475 | | - * Shows nav even if only have one section. |
| 492 | + * Shows tab even if only have one section. |
476 | 493 | * add_filter( 'hzfex_show_setting_section_tabs_if_single', '__return_true' ); |
477 | 494 | * |
478 | 495 | */ |
@@ -783,7 +800,7 @@ private function valid_fields() { |
783 | 800 | * |
784 | 801 | * NOTE: Use child-class instead |
785 | 802 | * - Highly recommended to add all fields from child-class {@method `sections()`}. |
786 | | - * - Use this filter only to add new fields to already an existing section added by others. |
| 803 | + * - Use this filter only to add new fields to an already existing section added by others. |
787 | 804 | * |
788 | 805 | * @param string $section_id -> the section key where field should be added. |
789 | 806 | * @param array $section_data['fields'] -> an array of fields that belong to that section. |
|
0 commit comments