documents
4 years ago
dynamic-tags
1 year ago
query-control
2 years ago
settings
1 year ago
theme-builder
1 year ago
column.php
1 year ago
common.php
6 months ago
container.php
1 year ago
section.php
1 year ago
templates-types-manager.php
3 years ago
container.php
51 lines
| 1 | <?php |
| 2 | namespace Auxin\Plugin\CoreElements\Elementor\Modules; |
| 3 | |
| 4 | |
| 5 | class Container { |
| 6 | |
| 7 | /** |
| 8 | * Instance of this class. |
| 9 | * |
| 10 | * @var object |
| 11 | */ |
| 12 | protected static $instance = null; |
| 13 | |
| 14 | |
| 15 | public function __construct(){ |
| 16 | // Modify render |
| 17 | add_action( 'elementor/frontend/container/before_render', array( $this, 'modify_render' ) ); |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * Return an instance of this class. |
| 22 | * |
| 23 | * @return object A single instance of this class. |
| 24 | */ |
| 25 | public static function get_instance() { |
| 26 | // If the single instance hasn't been set, set it now. |
| 27 | if ( null == self::$instance ) { |
| 28 | self::$instance = new self; |
| 29 | } |
| 30 | |
| 31 | return self::$instance; |
| 32 | } |
| 33 | |
| 34 | |
| 35 | /** |
| 36 | * Modify the render of column element |
| 37 | * |
| 38 | * @param Elementor\Includes\Elements\Container $container Instance of column element |
| 39 | * |
| 40 | * @return void |
| 41 | */ |
| 42 | public function modify_render( $container ){ |
| 43 | // Add parallax initializer to all upper containers elements |
| 44 | if ( ! $container->get_data( 'isInner' ) ) { |
| 45 | $container->add_render_attribute( '_wrapper', 'class', 'aux-parallax-section' ); |
| 46 | } |
| 47 | |
| 48 | } |
| 49 | |
| 50 | } |
| 51 |