PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 3.4.4
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v3.4.4
3.7.5 3.7.4 3.7.3 3.7.2 1-final 3.7.1 3.7.0 3.6.8 3.6.7 3.6.6 3.6.5 3.6.4 3.6.3 3.6.2 3.6.1 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.10 All 111 releases
← All changes | includes/Builder/PageTemplates.php +12 -2 3.0.93.4.4 View file →
@@ -18,11 +18,18 @@
18 18
19 19 // Add a filter to the save post to inject out template into the page cache.
20 20 // add_filter( 'wp_insert_post_data', [ $this, 'register_templates' ] );
21 21
22 + }
23 +
24 + public function get_template() {
25 + if(!empty($this->templates)){
26 + return $this->templates;
27 + }
22 28 $this->templates = [
23 29 self::TEMPLATE_HEADER_FOOTER => __( 'Templately Gutenberg Template', 'templately' ),
24 30 ];
31 + return $this->templates;
25 32 }
26 33
27 34 public function set_platform( $platform ): PageTemplates {
28 35 $this->platform = $platform;
@@ -84,8 +91,11 @@
84 91
85 92
86 93 switch ( $page_template ) {
87 94 case self::TEMPLATE_HEADER_FOOTER:
95 + // removes: Renders a 'viewport' meta tag.
96 + remove_action( 'wp_head', '_block_template_viewport_meta_tag', 0 );
97 +
88 98 if ( $this->platform === 'gutenberg' ) {
89 99 $template_path = $file . 'templates/templately-gutenberg-template.php';
90 100 } else {
91 101 $template_path = $file . 'templates/header-footer.php';
@@ -106,9 +116,9 @@
106 116 return self::TEMPLATE_HEADER_FOOTER;
107 117 }
108 118
109 119 public function add_new_template( $posts_templates ) {
110 - return array_merge( $posts_templates, $this->templates );
120 + return array_merge( $posts_templates, $this->get_template() );
111 121 }
112 122
113 123 public function register_templates( $atts ) {
114 124
@@ -127,9 +137,9 @@
127 137 wp_cache_delete( $cache_key, 'themes' );
128 138
129 139 // Now add our template to the list of templates by merging our templates.
130 140 // with the existing templates array from the cache.
131 - $templates = array_merge( $templates, $this->templates );
141 + $templates = array_merge( $templates, $this->get_template() );
132 142
133 143 // Add the modified cache to allow WordPress to pick it up for listing.
134 144 // available templates.
135 145 wp_cache_add( $cache_key, $templates, 'themes', 1800 );