header.php
66 lines
| 1 | <?php |
| 2 | namespace Auxin\Plugin\CoreElements\Elementor\Modules\Documents; |
| 3 | |
| 4 | use Elementor\Modules\Library\Documents\Library_Document; |
| 5 | use Elementor\Core\DocumentTypes\Post; |
| 6 | |
| 7 | if ( ! defined( 'ABSPATH' ) ) { |
| 8 | exit; // Exit if accessed directly |
| 9 | } |
| 10 | |
| 11 | /** |
| 12 | * Elementor section library document. |
| 13 | * |
| 14 | * Elementor section library document handler class is responsible for |
| 15 | * handling a document of a section type. |
| 16 | * |
| 17 | * @since 2.0.0 |
| 18 | */ |
| 19 | class Header extends Library_Document { |
| 20 | |
| 21 | public static function get_properties() { |
| 22 | $properties = parent::get_properties(); |
| 23 | |
| 24 | $properties['location'] = 'header'; |
| 25 | |
| 26 | return $properties; |
| 27 | } |
| 28 | |
| 29 | public function get_name() { |
| 30 | return 'header'; |
| 31 | } |
| 32 | |
| 33 | public static function get_title() { |
| 34 | return __( 'Header', 'auxin-elements' ); |
| 35 | } |
| 36 | |
| 37 | public function get_css_wrapper_selector() { |
| 38 | return '.elementor-' . $this->get_main_id(); |
| 39 | } |
| 40 | |
| 41 | protected static function get_editor_panel_categories() { |
| 42 | // Move to top as active. |
| 43 | $categories = [ |
| 44 | 'auxin-theme-elements' => [ |
| 45 | 'title' => __( 'Site Header', 'auxin-elements' ), |
| 46 | 'active' => true, |
| 47 | ], |
| 48 | ]; |
| 49 | |
| 50 | return $categories + parent::get_editor_panel_categories(); |
| 51 | } |
| 52 | |
| 53 | protected function _register_controls() { |
| 54 | parent::_register_controls(); |
| 55 | |
| 56 | Post::register_style_controls( $this ); |
| 57 | } |
| 58 | |
| 59 | /* For Adding Custom Classnames To Elementor Header |
| 60 | /*-------------------------------------*/ |
| 61 | // public function get_container_classes() { |
| 62 | // $classes = parent::get_container_classes(); |
| 63 | // $classes .= ' aux-elementor-header'; |
| 64 | // return $classes; |
| 65 | // } |
| 66 | } |