PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 1.1.4
ShopBuilder – WooCommerce Builder For Elementor v1.1.4
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 +62 -62 2.1.4 → 1.1.4 View file →
@@ -1,63 +1,63 @@
1 -<?php
2 -
3 -namespace RadiusTheme\SB\Modules\Compare;
4 -
5 -use RadiusTheme\SB\Helpers\Fns;
6 -use RadiusTheme\SB\Models\DataModel;
7 -
8 -// Do not allow directly accessing this file.
9 -if ( ! defined( 'ABSPATH' ) ) {
10 - exit( 'This script cannot be accessed directly.' );
11 -}
12 -
13 -
14 -class CompareInstaller {
15 -
16 - /**
17 - * Run the installer
18 - *
19 - * @return void
20 - */
21 - public function run() {
22 - $this->create_page();
23 - }
24 -
25 - /**
26 - * [create_page] Create page
27 - *
28 - * @return void [void]
29 - */
30 - private function create_page() {
31 -
32 - $page_id = Fns::get_option( 'modules', 'compare', 'page', 0, 'number' );
33 - if ( $page_id > 0 ) {
34 - $page_object = get_post( $page_id );
35 -
36 - if ( $page_object && 'page' === $page_object->post_type && ! in_array( $page_object->post_status, [
37 - 'pending',
38 - 'trash',
39 - 'future',
40 - 'auto-draft'
41 - ], true ) ) {
42 - // Valid page is already in place.
43 - return;
44 - }
45 - }
46 - if ( function_exists( 'WC' ) ) {
47 - if ( ! function_exists( 'wc_create_page' ) ) {
48 - require_once WC_ABSPATH . '/includes/admin/wc-admin-functions.php';
49 - }
50 - $create_page_id = wc_create_page(
51 - sanitize_title_with_dashes( _x( 'compare', 'page_slug', 'shopbuilder' ) ),
52 - '',
53 - esc_html__( 'Compare', 'shopbuilder' ),
54 - '<!-- wp:shortcode -->[rtsb_compare_list]<!-- /wp:shortcode -->'
55 - );
56 - 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 - }
61 - }
62 - }
1 +<?php
2 +
3 +namespace RadiusTheme\SB\Modules\Compare;
4 +
5 +use RadiusTheme\SB\Helpers\Fns;
6 +use RadiusTheme\SB\Models\DataModel;
7 +
8 +// Do not allow directly accessing this file.
9 +if ( ! defined( 'ABSPATH' ) ) {
10 + exit( 'This script cannot be accessed directly.' );
11 +}
12 +
13 +
14 +class CompareInstaller {
15 +
16 + /**
17 + * Run the installer
18 + *
19 + * @return void
20 + */
21 + public function run() {
22 + $this->create_page();
23 + }
24 +
25 + /**
26 + * [create_page] Create page
27 + *
28 + * @return void [void]
29 + */
30 + private function create_page() {
31 +
32 + $page_id = Fns::get_option( 'modules', 'compare', 'page', 0, 'number' );
33 + if ( $page_id > 0 ) {
34 + $page_object = get_post( $page_id );
35 +
36 + if ( $page_object && 'page' === $page_object->post_type && ! in_array( $page_object->post_status, [
37 + 'pending',
38 + 'trash',
39 + 'future',
40 + 'auto-draft'
41 + ], true ) ) {
42 + // Valid page is already in place.
43 + return;
44 + }
45 + }
46 + if ( function_exists( 'WC' ) ) {
47 + if ( ! function_exists( 'wc_create_page' ) ) {
48 + require_once WC_ABSPATH . '/includes/admin/wc-admin-functions.php';
49 + }
50 + $create_page_id = wc_create_page(
51 + sanitize_title_with_dashes( _x( 'compare', 'page_slug', 'shopbuilder' ) ),
52 + '',
53 + esc_html__( 'Compare', 'shopbuilder' ),
54 + '<!-- wp:shortcode -->[rtsb_compare_list]<!-- /wp:shortcode -->'
55 + );
56 + if ( $create_page_id ) {
57 + $section_items = DataModel::source()->get_option( 'modules', [] );
58 + $section_items['compare']['page'] = $create_page_id;
59 + DataModel::source()->set_option( 'modules', $section_items );
60 + }
61 + }
62 + }
63 63 }