Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 7 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| Colors_Manager_Control | |
0.00% |
0 / 7 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| enqueue | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| render_content | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName |
| 2 | |
| 3 | /** |
| 4 | * Custom Control class for the Colors |
| 5 | */ |
| 6 | class Colors_Manager_Control extends WP_Customize_Control { |
| 7 | |
| 8 | /** |
| 9 | * The color tool slug. |
| 10 | * |
| 11 | * @var String $type |
| 12 | */ |
| 13 | public $type = 'colorsTool'; |
| 14 | |
| 15 | /** |
| 16 | * Constructor. |
| 17 | * |
| 18 | * @param WP_Customize_Manager $manager the manager object. |
| 19 | * @param string $id the control ID. |
| 20 | * @param array $args An associative array containing arguments for the setting. |
| 21 | */ |
| 22 | public function __construct( $manager, $id, $args = array() ) { // phpcs:ignore Generic.CodeAnalysis.UselessOverridingMethod.Found -- not useless, the third argument is made optional. |
| 23 | parent::__construct( $manager, $id, $args ); |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * Enqueues the scripts and css. |
| 28 | */ |
| 29 | public function enqueue() { |
| 30 | wp_enqueue_media(); |
| 31 | Colors_Manager::admin_scripts_and_css(); |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Renders the control content. |
| 36 | */ |
| 37 | public function render_content() { |
| 38 | ?> |
| 39 | <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> |
| 40 | <div class="customize-control-content"> |
| 41 | <?php Colors_Manager::color_grid(); ?> |
| 42 | </div> |
| 43 | <?php |
| 44 | } |
| 45 | } |