Changeset 3410340
- Timestamp:
- 12/04/2025 03:23:12 AM (3 months ago)
- Location:
- sifency-addons
- Files:
-
- 8 edited
-
tags/1.0.4/includes/elementor/assets/css/menu.css (modified) (1 diff)
-
tags/1.0.4/theme-builder/builder-item/subheader.php (modified) (4 diffs)
-
tags/1.0.4/theme-builder/footer/class-footer-render.php (modified) (2 diffs)
-
tags/1.0.4/theme-builder/header/class-header-render.php (modified) (3 diffs)
-
trunk/includes/elementor/assets/css/menu.css (modified) (1 diff)
-
trunk/theme-builder/builder-item/subheader.php (modified) (4 diffs)
-
trunk/theme-builder/footer/class-footer-render.php (modified) (2 diffs)
-
trunk/theme-builder/header/class-header-render.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sifency-addons/tags/1.0.4/includes/elementor/assets/css/menu.css
r3409752 r3410340 257 257 .sifency-bp-1024 .sifency-nav-container { display: block; } 258 258 .sifency-bp-1024 { --is-mobile: 1; } 259 .sifency-bp-1024 .sifency-nav-menu { display: none; } 259 .sifency-bp-1024 .sifency-nav-menu { display: none; } /* Initially hide until toggled or fixed */ 260 260 .sifency-bp-1024.sifency-nav-wrapper { display: block; } 261 261 } -
sifency-addons/tags/1.0.4/theme-builder/builder-item/subheader.php
r3409752 r3410340 8 8 public function __construct() { 9 9 if ( is_admin() ) return; 10 11 add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_subheader_assets' ], 10 ); 12 add_action( 'admin_bar_menu', [ $this, 'add_admin_bar_link' ], 200 ); 10 13 add_action( 'template_redirect', [ $this, 'init_hooks' ] ); 14 } 15 16 public function enqueue_subheader_assets() { 17 if ( self::$rendered ) return; 18 19 $template_id = Sifency_Frontend_Helper::find_matching_template( 'subheader' ); 20 21 if ( ! $template_id || ! class_exists( '\Elementor\Plugin' ) ) { 22 return; 23 } 24 25 if ( class_exists( '\Elementor\Frontend' ) ) { 26 \Elementor\Plugin::instance()->frontend->enqueue_styles(); 27 \Elementor\Plugin::instance()->frontend->enqueue_scripts(); 28 } 29 30 $css_file = null; 31 if ( class_exists( '\Elementor\Core\Files\CSS\Post' ) ) { 32 $css_file = new \Elementor\Core\Files\CSS\Post( $template_id ); 33 } elseif ( class_exists( '\Elementor\Post_CSS_File' ) ) { 34 $css_file = new \Elementor\Post_CSS_File( $template_id ); 35 } 36 37 if ( $css_file ) { 38 $css_file->enqueue(); 39 } 40 if ( class_exists( '\Elementor\Plugin' ) ) { 41 ob_start(); 42 \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $template_id, true ); 43 ob_end_clean(); 44 } 45 } 46 47 public function add_admin_bar_link( \WP_Admin_Bar $admin_bar ) { 48 if ( ! current_user_can( 'edit_posts' ) || ! is_admin_bar_showing() ) { 49 return; 50 } 51 52 $template_id = Sifency_Frontend_Helper::find_matching_template( 'subheader' ); 53 54 if ( $template_id && class_exists( '\Elementor\Plugin' ) ) { 55 $admin_bar->add_node( [ 56 'id' => 'sifency-subheader-edit', 57 'parent' => 'elementor_edit_page', 58 'title' => __( 'Edit Subheader', 'sifency-addons' ), 59 'href' => admin_url( 'post.php?post=' . $template_id . '&action=elementor' ), 60 ] ); 61 } 11 62 } 12 63 … … 16 67 $template_id = Sifency_Frontend_Helper::find_matching_template( 'subheader' ); 17 68 if ( ! $template_id ) return; 18 19 69 add_action( 'get_header', [ $this, 'start_buffer' ], 15 ); 20 70 add_action( 'wp_footer', [ $this, 'end_buffer' ], 9999 ); … … 28 78 if ( ob_get_length() ) { 29 79 $content = ob_get_clean(); 80 30 81 if ( strpos( $content, 'sifency-elementor-below-header' ) !== false ) { 31 82 echo $content; … … 47 98 <!-- Sifency Elementor Below Header Start --> 48 99 <div class="sifency-elementor-below-header"> 49 <?php Sifency_Frontend_Helper::render_elementor_content( $template_id, true ); ?> 100 <?php 101 echo \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $template_id, true ); 102 ?> 50 103 </div> 51 104 <!-- Sifency Elementor Below Header End --> 52 105 <?php 53 106 $subheader_html = ob_get_clean(); 54 55 107 $pattern_custom = '/(<header[^>]*id="sifency-custom-header"[^>]*>.*?)(<\/header>)/is'; 56 108 $pattern_general = '/(<\/header>)/i'; -
sifency-addons/tags/1.0.4/theme-builder/footer/class-footer-render.php
r3409752 r3410340 5 5 6 6 public function __construct() { 7 add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_footer_assets' ], 10 ); 8 add_action( 'admin_bar_menu', [ $this, 'add_admin_bar_link' ], 200 ); 7 9 add_action( 'get_footer', [ $this, 'start_buffer' ], 1 ); 8 10 add_action( 'wp_footer', [ $this, 'end_buffer' ], 9999 ); 11 } 12 13 public function enqueue_footer_assets() { 14 $footer_id = Sifency_Frontend_Helper::find_matching_template( 'footer' ); 15 16 if ( ! $footer_id || ! class_exists( '\Elementor\Plugin' ) ) { 17 return; 18 } 19 20 if ( class_exists( '\Elementor\Frontend' ) ) { 21 \Elementor\Plugin::instance()->frontend->enqueue_styles(); 22 \Elementor\Plugin::instance()->frontend->enqueue_scripts(); 23 } 24 25 $css_file = null; 26 if ( class_exists( '\Elementor\Core\Files\CSS\Post' ) ) { 27 $css_file = new \Elementor\Core\Files\CSS\Post( $footer_id ); 28 } elseif ( class_exists( '\Elementor\Post_CSS_File' ) ) { 29 $css_file = new \Elementor\Post_CSS_File( $footer_id ); 30 } 31 32 if ( $css_file ) { 33 $css_file->enqueue(); 34 } 35 36 if ( class_exists( '\Elementor\Plugin' ) ) { 37 ob_start(); 38 \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $footer_id, true ); 39 ob_end_clean(); 40 } 41 } 42 43 public function add_admin_bar_link( \WP_Admin_Bar $admin_bar ) { 44 if ( ! current_user_can( 'edit_posts' ) || ! is_admin_bar_showing() ) { 45 return; 46 } 47 48 $footer_id = Sifency_Frontend_Helper::find_matching_template( 'footer' ); 49 50 if ( $footer_id && class_exists( '\Elementor\Plugin' ) ) { 51 $admin_bar->add_node( [ 52 'id' => 'sifency-footer-edit', 53 'parent' => 'elementor_edit_page', 54 'title' => __( 'Edit Footer', 'sifency-addons' ), 55 'href' => admin_url( 'post.php?post=' . $footer_id . '&action=elementor' ), 56 ] ); 57 } 9 58 } 10 59 … … 24 73 <!-- Sifency Custom Footer Start --> 25 74 <footer id="sifency-custom-footer" class="sifency-footer" itemscope itemtype="https://schema.org/WPFooter"> 26 <?php Sifency_Frontend_Helper::render_elementor_content( $template_id ); ?> 75 <?php 76 echo \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $template_id, true ); 77 ?> 27 78 </footer> 28 79 <!-- Sifency Custom Footer End --> 29 80 <?php 30 81 $custom_html = ob_get_clean(); 82 31 83 $pattern = '/<footer\b[^>]*>.*?<\/footer>/is'; 32 84 -
sifency-addons/tags/1.0.4/theme-builder/header/class-header-render.php
r3409752 r3410340 5 5 6 6 public function __construct() { 7 add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_header_assets' ], 10 ); 7 8 add_action( 'template_redirect', [ $this, 'sifency_addons_replace_header' ] ); 9 add_action( 'admin_bar_menu', [ $this, 'add_admin_bar_link' ], 200 ); 10 } 11 12 public function enqueue_header_assets() { 13 $header_id = Sifency_Frontend_Helper::find_matching_template( 'header' ); 14 15 if ( ! $header_id || ! class_exists( '\Elementor\Plugin' ) ) { 16 return; 17 } 18 19 if ( class_exists( '\Elementor\Frontend' ) ) { 20 \Elementor\Plugin::instance()->frontend->enqueue_styles(); 21 \Elementor\Plugin::instance()->frontend->enqueue_scripts(); 22 } 23 24 $css_file = null; 25 if ( class_exists( '\Elementor\Core\Files\CSS\Post' ) ) { 26 $css_file = new \Elementor\Core\Files\CSS\Post( $header_id ); 27 } elseif ( class_exists( '\Elementor\Post_CSS_File' ) ) { 28 $css_file = new \Elementor\Post_CSS_File( $header_id ); 29 } 30 31 if ( $css_file ) { 32 $css_file->enqueue(); 33 } 34 35 if ( class_exists( '\Elementor\Plugin' ) ) { 36 ob_start(); 37 \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $header_id, true ); 38 ob_end_clean(); 39 } 40 } 41 42 public function add_admin_bar_link( \WP_Admin_Bar $admin_bar ) { 43 if ( ! current_user_can( 'edit_posts' ) || ! is_admin_bar_showing() ) { 44 return; 45 } 46 47 $header_id = Sifency_Frontend_Helper::find_matching_template( 'header' ); 48 49 if ( $header_id && class_exists( '\Elementor\Plugin' ) ) { 50 $admin_bar->add_node( [ 51 'id' => 'sifency-header-edit', 52 'parent' => 'elementor_edit_page', 53 'title' => __( 'Edit Header', 'sifency-addons' ), 54 'href' => admin_url( 'post.php?post=' . $header_id . '&action=elementor' ), 55 ] ); 56 } 8 57 } 9 58 10 59 public function sifency_addons_replace_header() { 11 60 $header_id = Sifency_Frontend_Helper::find_matching_template( 'header' ); 61 if ( ! $header_id ) return; 12 62 13 if ( ! $header_id ) {14 return;15 }16 63 add_action( 'get_header', [ $this, 'start_buffer' ] ); 17 64 add_action( 'wp_footer', [ $this, 'end_buffer' ], 9999 ); … … 32 79 ?> 33 80 <header id="sifency-custom-header" class="sifency-header" itemscope itemtype="https://schema.org/WPHeader"> 34 <?php Sifency_Frontend_Helper::render_elementor_content( $header_id ); ?> 81 <?php 82 echo \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $header_id, true ); 83 ?> 35 84 </header> 36 85 <?php 37 86 $custom_header_html = ob_get_clean(); 87 38 88 $pattern = '/<header[^>]*>.*?<\/header>/is'; 39 40 89 if ( preg_match( $pattern, $content ) ) { 41 90 $content = preg_replace( $pattern, $custom_header_html, $content, 1 ); … … 44 93 } 45 94 } 46 47 echo $content; // phpcs:ignore WordPress.Security.NonceVerification.Recommended 95 echo $content; 48 96 } 49 97 } -
sifency-addons/trunk/includes/elementor/assets/css/menu.css
r3409752 r3410340 257 257 .sifency-bp-1024 .sifency-nav-container { display: block; } 258 258 .sifency-bp-1024 { --is-mobile: 1; } 259 .sifency-bp-1024 .sifency-nav-menu { display: none; } 259 .sifency-bp-1024 .sifency-nav-menu { display: none; } /* Initially hide until toggled or fixed */ 260 260 .sifency-bp-1024.sifency-nav-wrapper { display: block; } 261 261 } -
sifency-addons/trunk/theme-builder/builder-item/subheader.php
r3409752 r3410340 8 8 public function __construct() { 9 9 if ( is_admin() ) return; 10 11 add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_subheader_assets' ], 10 ); 12 add_action( 'admin_bar_menu', [ $this, 'add_admin_bar_link' ], 200 ); 10 13 add_action( 'template_redirect', [ $this, 'init_hooks' ] ); 14 } 15 16 public function enqueue_subheader_assets() { 17 if ( self::$rendered ) return; 18 19 $template_id = Sifency_Frontend_Helper::find_matching_template( 'subheader' ); 20 21 if ( ! $template_id || ! class_exists( '\Elementor\Plugin' ) ) { 22 return; 23 } 24 25 if ( class_exists( '\Elementor\Frontend' ) ) { 26 \Elementor\Plugin::instance()->frontend->enqueue_styles(); 27 \Elementor\Plugin::instance()->frontend->enqueue_scripts(); 28 } 29 30 $css_file = null; 31 if ( class_exists( '\Elementor\Core\Files\CSS\Post' ) ) { 32 $css_file = new \Elementor\Core\Files\CSS\Post( $template_id ); 33 } elseif ( class_exists( '\Elementor\Post_CSS_File' ) ) { 34 $css_file = new \Elementor\Post_CSS_File( $template_id ); 35 } 36 37 if ( $css_file ) { 38 $css_file->enqueue(); 39 } 40 if ( class_exists( '\Elementor\Plugin' ) ) { 41 ob_start(); 42 \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $template_id, true ); 43 ob_end_clean(); 44 } 45 } 46 47 public function add_admin_bar_link( \WP_Admin_Bar $admin_bar ) { 48 if ( ! current_user_can( 'edit_posts' ) || ! is_admin_bar_showing() ) { 49 return; 50 } 51 52 $template_id = Sifency_Frontend_Helper::find_matching_template( 'subheader' ); 53 54 if ( $template_id && class_exists( '\Elementor\Plugin' ) ) { 55 $admin_bar->add_node( [ 56 'id' => 'sifency-subheader-edit', 57 'parent' => 'elementor_edit_page', 58 'title' => __( 'Edit Subheader', 'sifency-addons' ), 59 'href' => admin_url( 'post.php?post=' . $template_id . '&action=elementor' ), 60 ] ); 61 } 11 62 } 12 63 … … 16 67 $template_id = Sifency_Frontend_Helper::find_matching_template( 'subheader' ); 17 68 if ( ! $template_id ) return; 18 19 69 add_action( 'get_header', [ $this, 'start_buffer' ], 15 ); 20 70 add_action( 'wp_footer', [ $this, 'end_buffer' ], 9999 ); … … 28 78 if ( ob_get_length() ) { 29 79 $content = ob_get_clean(); 80 30 81 if ( strpos( $content, 'sifency-elementor-below-header' ) !== false ) { 31 82 echo $content; … … 47 98 <!-- Sifency Elementor Below Header Start --> 48 99 <div class="sifency-elementor-below-header"> 49 <?php Sifency_Frontend_Helper::render_elementor_content( $template_id, true ); ?> 100 <?php 101 echo \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $template_id, true ); 102 ?> 50 103 </div> 51 104 <!-- Sifency Elementor Below Header End --> 52 105 <?php 53 106 $subheader_html = ob_get_clean(); 54 55 107 $pattern_custom = '/(<header[^>]*id="sifency-custom-header"[^>]*>.*?)(<\/header>)/is'; 56 108 $pattern_general = '/(<\/header>)/i'; -
sifency-addons/trunk/theme-builder/footer/class-footer-render.php
r3409752 r3410340 5 5 6 6 public function __construct() { 7 add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_footer_assets' ], 10 ); 8 add_action( 'admin_bar_menu', [ $this, 'add_admin_bar_link' ], 200 ); 7 9 add_action( 'get_footer', [ $this, 'start_buffer' ], 1 ); 8 10 add_action( 'wp_footer', [ $this, 'end_buffer' ], 9999 ); 11 } 12 13 public function enqueue_footer_assets() { 14 $footer_id = Sifency_Frontend_Helper::find_matching_template( 'footer' ); 15 16 if ( ! $footer_id || ! class_exists( '\Elementor\Plugin' ) ) { 17 return; 18 } 19 20 if ( class_exists( '\Elementor\Frontend' ) ) { 21 \Elementor\Plugin::instance()->frontend->enqueue_styles(); 22 \Elementor\Plugin::instance()->frontend->enqueue_scripts(); 23 } 24 25 $css_file = null; 26 if ( class_exists( '\Elementor\Core\Files\CSS\Post' ) ) { 27 $css_file = new \Elementor\Core\Files\CSS\Post( $footer_id ); 28 } elseif ( class_exists( '\Elementor\Post_CSS_File' ) ) { 29 $css_file = new \Elementor\Post_CSS_File( $footer_id ); 30 } 31 32 if ( $css_file ) { 33 $css_file->enqueue(); 34 } 35 36 if ( class_exists( '\Elementor\Plugin' ) ) { 37 ob_start(); 38 \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $footer_id, true ); 39 ob_end_clean(); 40 } 41 } 42 43 public function add_admin_bar_link( \WP_Admin_Bar $admin_bar ) { 44 if ( ! current_user_can( 'edit_posts' ) || ! is_admin_bar_showing() ) { 45 return; 46 } 47 48 $footer_id = Sifency_Frontend_Helper::find_matching_template( 'footer' ); 49 50 if ( $footer_id && class_exists( '\Elementor\Plugin' ) ) { 51 $admin_bar->add_node( [ 52 'id' => 'sifency-footer-edit', 53 'parent' => 'elementor_edit_page', 54 'title' => __( 'Edit Footer', 'sifency-addons' ), 55 'href' => admin_url( 'post.php?post=' . $footer_id . '&action=elementor' ), 56 ] ); 57 } 9 58 } 10 59 … … 24 73 <!-- Sifency Custom Footer Start --> 25 74 <footer id="sifency-custom-footer" class="sifency-footer" itemscope itemtype="https://schema.org/WPFooter"> 26 <?php Sifency_Frontend_Helper::render_elementor_content( $template_id ); ?> 75 <?php 76 echo \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $template_id, true ); 77 ?> 27 78 </footer> 28 79 <!-- Sifency Custom Footer End --> 29 80 <?php 30 81 $custom_html = ob_get_clean(); 82 31 83 $pattern = '/<footer\b[^>]*>.*?<\/footer>/is'; 32 84 -
sifency-addons/trunk/theme-builder/header/class-header-render.php
r3409752 r3410340 5 5 6 6 public function __construct() { 7 add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_header_assets' ], 10 ); 7 8 add_action( 'template_redirect', [ $this, 'sifency_addons_replace_header' ] ); 9 add_action( 'admin_bar_menu', [ $this, 'add_admin_bar_link' ], 200 ); 10 } 11 12 public function enqueue_header_assets() { 13 $header_id = Sifency_Frontend_Helper::find_matching_template( 'header' ); 14 15 if ( ! $header_id || ! class_exists( '\Elementor\Plugin' ) ) { 16 return; 17 } 18 19 if ( class_exists( '\Elementor\Frontend' ) ) { 20 \Elementor\Plugin::instance()->frontend->enqueue_styles(); 21 \Elementor\Plugin::instance()->frontend->enqueue_scripts(); 22 } 23 24 $css_file = null; 25 if ( class_exists( '\Elementor\Core\Files\CSS\Post' ) ) { 26 $css_file = new \Elementor\Core\Files\CSS\Post( $header_id ); 27 } elseif ( class_exists( '\Elementor\Post_CSS_File' ) ) { 28 $css_file = new \Elementor\Post_CSS_File( $header_id ); 29 } 30 31 if ( $css_file ) { 32 $css_file->enqueue(); 33 } 34 35 if ( class_exists( '\Elementor\Plugin' ) ) { 36 ob_start(); 37 \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $header_id, true ); 38 ob_end_clean(); 39 } 40 } 41 42 public function add_admin_bar_link( \WP_Admin_Bar $admin_bar ) { 43 if ( ! current_user_can( 'edit_posts' ) || ! is_admin_bar_showing() ) { 44 return; 45 } 46 47 $header_id = Sifency_Frontend_Helper::find_matching_template( 'header' ); 48 49 if ( $header_id && class_exists( '\Elementor\Plugin' ) ) { 50 $admin_bar->add_node( [ 51 'id' => 'sifency-header-edit', 52 'parent' => 'elementor_edit_page', 53 'title' => __( 'Edit Header', 'sifency-addons' ), 54 'href' => admin_url( 'post.php?post=' . $header_id . '&action=elementor' ), 55 ] ); 56 } 8 57 } 9 58 10 59 public function sifency_addons_replace_header() { 11 60 $header_id = Sifency_Frontend_Helper::find_matching_template( 'header' ); 61 if ( ! $header_id ) return; 12 62 13 if ( ! $header_id ) {14 return;15 }16 63 add_action( 'get_header', [ $this, 'start_buffer' ] ); 17 64 add_action( 'wp_footer', [ $this, 'end_buffer' ], 9999 ); … … 32 79 ?> 33 80 <header id="sifency-custom-header" class="sifency-header" itemscope itemtype="https://schema.org/WPHeader"> 34 <?php Sifency_Frontend_Helper::render_elementor_content( $header_id ); ?> 81 <?php 82 echo \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $header_id, true ); 83 ?> 35 84 </header> 36 85 <?php 37 86 $custom_header_html = ob_get_clean(); 87 38 88 $pattern = '/<header[^>]*>.*?<\/header>/is'; 39 40 89 if ( preg_match( $pattern, $content ) ) { 41 90 $content = preg_replace( $pattern, $custom_header_html, $content, 1 ); … … 44 93 } 45 94 } 46 47 echo $content; // phpcs:ignore WordPress.Security.NonceVerification.Recommended 95 echo $content; 48 96 } 49 97 }
Note: See TracChangeset
for help on using the changeset viewer.