PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.6.2
ShopBuilder – WooCommerce Builder For Elementor v2.6.2
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/BuilderController.php +14 -8 2.2.22.6.2 View file →
@@ -60,16 +60,13 @@
60 60 BuilderHooks::instance();
61 61 }
62 62
63 63 BuilderCpt::instance();
64 -
65 - $this->elementor_init();
66 - $this->both_builder_frontend();
67 -
68 - // add_action( 'elementor/init', [ $this, 'elementor_init' ] );
69 - add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'editor_scripts' ] );
70 - // add_action( 'template_redirect', [ $this, 'both_builder_frontend' ], 99 );
71 -
64 + if ( defined( 'ELEMENTOR_VERSION' ) ) {
65 + $this->elementor_init();
66 + $this->both_builder_frontend();
67 + add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'editor_scripts' ] );
68 + }
72 69 // RT Select2 Ajax.
73 70 add_action( 'wp_ajax_rtsb_select2_object_search', [ $this, 'select2_ajax_posts_filter_autocomplete' ] );
74 71 add_action( 'wp_ajax_nopriv_rtsb_select2_object_search', [ $this, 'select2_ajax_posts_filter_autocomplete' ] );
75 72 // Select2 ajax save data.
@@ -555,8 +552,17 @@
555 552 }
556 553
557 554 if ( ! empty( $search ) ) {
558 555 $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_title LIKE %s", '%' . esc_sql( $search ) . '%' );
556 + }
557 +
558 + // Add a query for shop_coupon post-type to check 'show on frontend' meta.
559 + if ( 'shop_coupon' === $post_type ) {
560 + $where .= " AND {$wpdb->posts}.ID IN (
561 + SELECT post_id FROM {$wpdb->postmeta}
562 + WHERE meta_key = 'rtsb_show_on_frontend'
563 + AND meta_value = 'on'
564 + )";
559 565 }
560 566
561 567 $query = "select post_title,ID from $wpdb->posts where post_status = 'publish' {$where} {$limit}";
562 568 $results = $wpdb->get_results( $query ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.NoCaching