/before_render', array( $this, 'add_attributes_to_ft_elements' ) ); add_action( 'elementor/widget/render_content', array( $this, 'add_div_after_ft_elements' ), 10, 2 ); } public function add_attributes_to_ft_elements( $element ) { if ( ! $element->get_settings( 'query_id' ) ) { return; } $element->add_render_attribute( '_wrapper', [ 'class' => 'pcft-elers-wrapper pcft-ele-' . $element->get_settings( 'query_id' ), ] ); } public function add_div_after_ft_elements( $widget_content, $widget ) { if ( ! $widget->get_settings( 'query_id' ) ) { return $widget_content; } return $widget_content . penci_get_html_animation_loading( 'df' ); } /** * @param string $module_name * * @return Module_Base|Module_Base[] */ public function get_modules( $module_name ) { if ( $module_name ) { if ( isset( $this->modules[ $module_name ] ) ) { return $this->modules[ $module_name ]; } return null; } return $this->modules; } public function add_column_attribute( $element ) { $settings = $element->get_settings(); $current_column_order = $this->column_order; $element->add_render_attribute( array( '_inner_wrapper' => array( 'class' => 'theiaStickySidebar' ), '_wrapper' => array( 'class' => array( 'penci-ercol-' . $settings['_column_size'], 'penci-ercol-order-' . $current_column_order, in_array( $settings['_column_size'], array( 33, 25 ) ) ? 'penci-sticky-sb' : 'penci-sticky-ct', in_array( $settings['_column_size'], array( 33, 25 ) ) ? 'penci-sidebarSC' : '', $settings['background_background'] ? 'penci-dmcheck penci-elbg-activate' : '', isset( $settings['background_image']['url'] ) && $settings['background_image']['url'] ? 'penci-elbg-img' : '' ) ) ) ); $this->column_order = $current_column_order + 1; } public function add_container_attribute( $element ) { $settings = $element->get_settings(); $enable_sticky = isset( $settings['penci_enable_sticky'] ) ? $settings['penci_enable_sticky'] : false; $wrap = $element->get_data( 'isInner' ) ? 'e-child' : 'e-parent'; if ( 'e-parent' == $wrap && $enable_sticky ) { $this->column_order = 1; $class = 'penci-section'; $class .= $settings['background_background'] ? ' penci-dmcheck penci-elbg-activate' : ''; $class .= isset( $settings['background_image']['url'] ) && $settings['background_image']['url'] ? ' penci-elbg-img' : ''; if ( ! $enable_sticky ) { $class .= ' penci-disSticky'; } else { $class .= ' penci-enSticky'; } $element->add_render_attribute( '_wrapper', array( 'class' => $class, ) ); } if ( 'e-child' == $wrap && $enable_sticky ) { $current_column_order = $this->column_order; $element->add_render_attribute( array( '_wrapper' => array( 'class' => array( 'pc-container-sticky', $current_column_order + 1 > 2 ? 'penci-sticky-sb penci-sidebarSC' : 'penci-sticky-ct', $settings['background_background'] ? 'penci-dmcheck penci-elbg-activate' : '', isset( $settings['background_image']['url'] ) && $settings['background_image']['url'] ? 'penci-elbg-img' : '' ) ) ) ); $this->column_order = $current_column_order + 1; } } public function add_section_attribute( $element ) { $settings = $element->get_settings(); $enable_sticky = isset( $settings['penci_enable_sticky'] ) ? $settings['penci_enable_sticky'] : false; $enable_repons_twosb = isset( $settings['penci_enable_repons_section'] ) ? $settings['penci_enable_repons_section'] : false; $ctsidebar_mb = isset( $settings['penci_ctsidebar_mb'] ) ? $settings['penci_ctsidebar_mb'] : 'con_sb2_sb1'; $structure = isset( $settings['structure'] ) ? $settings['structure'] : ''; $this->column_order = 1; $class = 'penci-section'; $class .= $settings['background_background'] ? ' penci-dmcheck penci-elbg-activate' : ''; $class .= isset( $settings['background_image']['url'] ) && $settings['background_image']['url'] ? ' penci-elbg-img' : ''; if ( ! $enable_sticky ) { $class .= ' penci-disSticky'; } else { $class .= ' penci-enSticky'; } if ( $enable_repons_twosb ) { $class .= ' penci-repons-elsection'; $class .= ' penci-' . $ctsidebar_mb; } if ( $structure ) { $class .= ' penci-structure-' . $structure; } $element->add_render_attribute( '_wrapper', array( 'class' => $class, ) ); } }