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/Modules/Compare/CompareInstaller.php +12 -8 2.1.33.2.6 View file →
@@ -2,9 +2,8 @@
2 2
3 3 namespace RadiusTheme\SB\Modules\Compare;
4 4
5 5 use RadiusTheme\SB\Helpers\Fns;
6 -use RadiusTheme\SB\Models\DataModel;
7 6
8 7 // Do not allow directly accessing this file.
9 8 if ( ! defined( 'ABSPATH' ) ) {
10 9 exit( 'This script cannot be accessed directly.' );
@@ -32,14 +31,18 @@
32 31 $page_id = Fns::get_option( 'modules', 'compare', 'page', 0, 'number' );
33 32 if ( $page_id > 0 ) {
34 33 $page_object = get_post( $page_id );
35 34
36 - if ( $page_object && 'page' === $page_object->post_type && ! in_array( $page_object->post_status, [
35 + if ( $page_object && 'page' === $page_object->post_type && ! in_array(
36 + $page_object->post_status,
37 + [
37 38 'pending',
38 39 'trash',
39 40 'future',
40 - 'auto-draft'
41 - ], true ) ) {
41 + 'auto-draft',
42 + ],
43 + true
44 + ) ) {
42 45 // Valid page is already in place.
43 46 return;
44 47 }
45 48 }
@@ -53,11 +56,12 @@
53 56 esc_html__( 'Compare', 'shopbuilder' ),
54 57 '<!-- wp:shortcode -->[rtsb_compare_list]<!-- /wp:shortcode -->'
55 58 );
56 59 if ( $create_page_id ) {
57 - $section_items = DataModel::source()->get_option( 'modules', [] );
58 - $section_items['compare']['page'] = strval( $create_page_id );
59 - DataModel::source()->set_option( 'modules', $section_items );
60 + $section_items = [];
61 + $section_items['page'] = strval( $create_page_id );
62 + Fns::set_options( 'modules', 'compare', $section_items );
63 +
60 64 }
61 65 }
62 66 }
63 -}
67 +}