PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.2.6
ShopBuilder – WooCommerce Builder For Elementor v3.2.6
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
← All changes | app/Controllers/Admin/Ajax/DefaultTemplate.php +8 -7 2.2.03.2.6 View file →
@@ -41,19 +41,19 @@
41 41 if ( ! current_user_can( 'manage_options' ) ) {
42 42 wp_send_json_error();
43 43 }
44 44 $page_type = isset( $_POST['template_type'] ) ? sanitize_text_field( wp_unslash( $_POST['template_type'] ) ) : null; // phpcs:ignore WordPress.Security.NonceVerification.Missing
45 - $default_page_id = isset( $_POST['set_default_page_id'] ) && 'publish' === get_post_status( $_POST['set_default_page_id'] ) ? absint( wp_unslash( $_POST['set_default_page_id'] ) ) : null; // phpcs:ignore WordPress.Security.NonceVerification.Missing
46 - $page_id = isset( $_POST['page_id'] ) && 'publish' === get_post_status( $_POST['page_id'] ) ? absint( wp_unslash( $_POST['page_id'] ) ) : null; // phpcs:ignore WordPress.Security.NonceVerification.Missing
45 + $default_page_id = isset( $_POST['set_default_page_id'] ) && 'publish' === get_post_status( $_POST['set_default_page_id'] ) ? absint( wp_unslash( $_POST['set_default_page_id'] ) ) : null; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
46 + $page_id = isset( $_POST['page_id'] ) && 'publish' === get_post_status( $_POST['page_id'] ) ? absint( wp_unslash( $_POST['page_id'] ) ) : null; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
47 47 Cache::clear_transient_cache();
48 - $the_cat_option = BuilderFns::archive_option_name_by_template_id( $page_id );
49 - $the_cats = TemplateSettings::instance()->get_option( $the_cat_option );
50 - $option_name = BuilderFns::option_name( $page_type );
51 - $product_page_for = get_post_meta( $page_id, '_is_product_page_template_for', true );
52 -
48 + $the_cat_option = BuilderFns::archive_option_name_by_template_id( $page_id );
49 + $the_cats = TemplateSettings::instance()->get_option( $the_cat_option );
50 + $option_name = BuilderFns::option_name( $page_type );
51 + $product_page_for = get_post_meta( $page_id, '_is_product_page_template_for', true );
53 52 $is_can_set_default = true;
54 53 switch ( $page_type ) {
55 54 case 'product':
55 + $product_page_for = empty( $product_page_for ) ? 'all_products' : $product_page_for;
56 56 if ( 'all_products' !== $product_page_for ) {
57 57 $is_can_set_default = null;
58 58 }
59 59 break;
@@ -63,8 +63,9 @@
63 63 }
64 64 break;
65 65 default:
66 66 }
67 +
67 68 if ( $is_can_set_default ) {
68 69 TemplateSettings::instance()->set_option( $option_name, $default_page_id );
69 70 }
70 71