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/ThemeBuilder.php +1 -16 3.7.33.1.2 View file →
@@ -50,13 +50,8 @@
50 50 add_action( 'pre_get_posts', [ $this, 'pre_get_posts' ], 1 );
51 51 add_action( 'wp', function () {
52 52 new TemplateLoader( $this, self::$views );
53 53 } );
54 - // Unconditional (admin + front end): the editor's admin page bootstrap
55 - // (post.php?action=elementor) never fires `wp`, so this can't be gated
56 - // behind the TemplateLoader instantiation above. See TemplateLoader::
57 - // register_preview_product_hooks() for why two render pathways are covered.
58 - TemplateLoader::register_preview_product_hooks();
59 54
60 55 add_action( 'init', [ $this, 'source_register' ] );
61 56 add_action( 'wp_ajax_templately_create_template', [ $this, 'create_template' ] );
62 57
@@ -103,14 +98,8 @@
103 98
104 99 public function create_template() {
105 100 check_admin_referer( 'templately_create_template' );
106 101
107 - // Check user capability
108 - if (!current_user_can('delete_posts')) {
109 - wp_send_json_error(['message' => 'Insufficient permissions']);
110 - wp_die();
111 - }
112 -
113 102 $_type = sanitize_text_field( wp_unslash( $_POST['template_type'] ) );
114 103
115 104 $_meta = [];
116 105
@@ -204,10 +193,9 @@
204 193 return $post_id;
205 194 }
206 195
207 196 public function modify_template_type( $value, $object_id, $meta_key, $single ) {
208 - $_value = $value;
209 - if ( empty($value) && Document::TYPE_META_KEY === $meta_key && Source::CPT === get_post_type( $object_id ) ) {
197 + if ( Document::TYPE_META_KEY === $meta_key && Source::CPT === get_post_type( $object_id ) ) {
210 198 remove_filter( 'get_post_metadata', [ $this, 'modify_template_type' ] );
211 199 $value = get_post_meta( $object_id, Source::TYPE_META_KEY, $single );
212 200 $arr = [
213 201 'post' => 'single-post',
@@ -219,11 +207,8 @@
219 207 'course_archive' => 'archive',
220 208 ];
221 209 $key = $single ? $value : (isset($value[0]) ? $value[0] : '');
222 210 $value = isset( $arr[ $key ] ) ? $arr[ $key ] : $value;
223 - if(in_array($value, ['header', 'footer'])){
224 - return $_value;
225 - }
226 211 }
227 212
228 213 return $value;
229 214 }