PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 3.1.2
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v3.1.2
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 +2 -12 3.7.33.1.2 View file →
@@ -18,18 +18,11 @@
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 - }
28 22 $this->templates = [
29 23 self::TEMPLATE_HEADER_FOOTER => __( 'Templately Gutenberg Template', 'templately' ),
30 24 ];
31 - return $this->templates;
32 25 }
33 26
34 27 public function set_platform( $platform ): PageTemplates {
35 28 $this->platform = $platform;
@@ -91,11 +84,8 @@
91 84
92 85
93 86 switch ( $page_template ) {
94 87 case self::TEMPLATE_HEADER_FOOTER:
95 - // removes: Renders a 'viewport' meta tag.
96 - remove_action( 'wp_head', '_block_template_viewport_meta_tag', 0 );
97 -
98 88 if ( $this->platform === 'gutenberg' ) {
99 89 $template_path = $file . 'templates/templately-gutenberg-template.php';
100 90 } else {
101 91 $template_path = $file . 'templates/header-footer.php';
@@ -116,9 +106,9 @@
116 106 return self::TEMPLATE_HEADER_FOOTER;
117 107 }
118 108
119 109 public function add_new_template( $posts_templates ) {
120 - return array_merge( $posts_templates, $this->get_template() );
110 + return array_merge( $posts_templates, $this->templates );
121 111 }
122 112
123 113 public function register_templates( $atts ) {
124 114
@@ -137,9 +127,9 @@
137 127 wp_cache_delete( $cache_key, 'themes' );
138 128
139 129 // Now add our template to the list of templates by merging our templates.
140 130 // with the existing templates array from the cache.
141 - $templates = array_merge( $templates, $this->get_template() );
131 + $templates = array_merge( $templates, $this->templates );
142 132
143 133 // Add the modified cache to allow WordPress to pick it up for listing.
144 134 // available templates.
145 135 wp_cache_add( $cache_key, $templates, 'themes', 1800 );