HeadlineToggle.php
45 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Customizer Control: kirki-headline-toggle. |
| 4 | * |
| 5 | * @package kirki-headline-toggle |
| 6 | * @since 1.0 |
| 7 | */ |
| 8 | |
| 9 | namespace Kirki\Control; |
| 10 | |
| 11 | use Kirki\Control\Checkbox_Switch; |
| 12 | |
| 13 | // Exit if accessed directly. |
| 14 | if ( ! defined( 'ABSPATH' ) ) { |
| 15 | exit; |
| 16 | } |
| 17 | |
| 18 | /** |
| 19 | * Headline toggle control |
| 20 | */ |
| 21 | class HeadlineToggle extends Checkbox_Switch { |
| 22 | |
| 23 | /** |
| 24 | * The class constructor. |
| 25 | * |
| 26 | * @since 1.0 |
| 27 | * |
| 28 | * @param WP_Customize_Manager $manager Customizer bootstrap instance. |
| 29 | * @param string $id Control ID. |
| 30 | * @param array $args The control arguments. |
| 31 | */ |
| 32 | public function __construct( $manager, $id, $args = array() ) { |
| 33 | |
| 34 | parent::__construct( $manager, $id, $args ); |
| 35 | |
| 36 | if ( isset( $args['wrapper_attrs'] ) && isset( $args['wrapper_attrs']['class'] ) ) { |
| 37 | $this->wrapper_attrs['class'] = '{default_class} ' . $args['wrapper_attrs']['class'] . ' customize-control-kirki-headline-toggle'; |
| 38 | } else { |
| 39 | $this->wrapper_attrs['class'] = '{default_class} customize-control-kirki-headline-toggle'; |
| 40 | } |
| 41 | |
| 42 | } |
| 43 | |
| 44 | } |
| 45 |