PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.6.0
ShopBuilder – WooCommerce Builder For Elementor v2.6.0
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 +29 -22 2.1.82.6.0 View file →
@@ -60,22 +60,19 @@
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 - add_action( 'wp_ajax_rt_select2_object_search', [ $this, 'select2_ajax_posts_filter_autocomplete' ] );
74 - add_action( 'wp_ajax_nopriv_rt_select2_object_search', [ $this, 'select2_ajax_posts_filter_autocomplete' ] );
70 + add_action( 'wp_ajax_rtsb_select2_object_search', [ $this, 'select2_ajax_posts_filter_autocomplete' ] );
71 + add_action( 'wp_ajax_nopriv_rtsb_select2_object_search', [ $this, 'select2_ajax_posts_filter_autocomplete' ] );
75 72 // Select2 ajax save data.
76 - add_action( 'wp_ajax_rt_select2_get_title', [ $this, 'select2_ajax_get_posts_value_titles' ] );
77 - add_action( 'wp_ajax_nopriv_rt_select2_get_title', [ $this, 'select2_ajax_get_posts_value_titles' ] );
73 + add_action( 'wp_ajax_rtsb_select2_get_title', [ $this, 'select2_ajax_get_posts_value_titles' ] );
74 + add_action( 'wp_ajax_nopriv_rtsb_select2_get_title', [ $this, 'select2_ajax_get_posts_value_titles' ] );
78 75 }
79 76
80 77 /**
81 78 * Apply for frontend.
@@ -108,12 +105,15 @@
108 105 * @return void
109 106 */
110 107 public function add_elementor_widget_categories( $elements_manager ) {
111 108 $categories = [];
112 - $type = BuilderFns::builder_type( get_the_ID() );
109 + $builder_id = get_queried_object_id();
110 + $id = Fns::wpml_object_id( $builder_id, BuilderFns::$post_type_tb, 'default' );
111 + $type = BuilderFns::builder_type( $id );
112 +
113 113 if ( $type ) {
114 114 $builder_type = ! empty( BuilderFns::builder_page_types()[ $type ] ) ? BuilderFns::builder_page_types()[ $type ] : '';
115 - $builder_type = str_replace( 'My Account - ', '', $builder_type );
115 + $builder_type = str_replace( [ 'My Account - ', 'Endpoint: ' ], '', $builder_type );
116 116 $categories['rtsb-shopbuilder'] = [
117 117 'title' => esc_html__( 'ShopBuilder', 'shopbuilder' ) . ' - ' . ucfirst( $builder_type ),
118 118 'icon' => 'fa fa-plug',
119 119 ];
@@ -123,9 +123,10 @@
123 123 'title' => esc_html__( 'Shopbuilder - General', 'shopbuilder' ),
124 124 'icon' => 'fa fa-plug',
125 125 ];
126 126 }
127 - $categories = apply_filters( 'rtsb_elementor_widgets_category_lists', $categories );
127 + $categories = apply_filters( 'rtsb_elementor_widgets_category_lists', $categories );
128 +
128 129 $other_categories = $elements_manager->get_categories();
129 130 $categories = array_merge(
130 131 array_slice( $other_categories, 0, 1 ),
131 132 $categories,
@@ -131,10 +132,10 @@
131 132 $categories,
132 133 array_slice( $other_categories, 1 )
133 134 );
134 135
135 - $set_categories = function ( $categories ) {
136 - $this->categories = $categories;
136 + $set_categories = function ( $categories ) use ( $elements_manager ) {
137 + $elements_manager->categories = $categories;
137 138 };
138 139
139 140 $set_categories->call( $elements_manager, $categories );
140 141 }
@@ -226,9 +227,9 @@
226 227 *
227 228 * @return array
228 229 */
229 230 public function rtsb_icons( $tabs = [] ) {
230 - $custom_icons = $this->get_icons();
231 + $custom_icons = Fns::get_custom_icon_names();
231 232
232 233 $tabs['shopbuilder-icons'] = [
233 234 'name' => 'rtsb-fonts',
234 235 'label' => esc_html__( 'ShopBuilder Icons', 'shopbuilder' ),
@@ -376,15 +377,18 @@
376 377 $post_type = 'post';
377 378 $source_name = 'post_type';
378 379 $paged = absint( $_POST['page'] ?? 1 );
379 380 if ( ! empty( $_POST['post_type'] ) ) {
381 + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash
380 382 $post_type = sanitize_text_field( $_POST['post_type'] );
381 383 }
382 384
383 385 if ( ! empty( $_POST['source_name'] ) ) {
386 + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash
384 387 $source_name = sanitize_text_field( $_POST['source_name'] );
385 388 }
386 389
390 + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash
387 391 $search = ! empty( $_POST['search'] ) ? sanitize_text_field( $_POST['search'] ) : '';
388 392 $results = $post_list = [];
389 393 switch ( $source_name ) {
390 394 case 'taxonomy':
@@ -452,13 +456,14 @@
452 456 if ( empty( $_POST['id'] ) ) {
453 457 wp_send_json_error( [] );
454 458 }
455 459
460 + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
456 461 if ( empty( array_filter( $_POST['id'] ) ) ) {
457 462 wp_send_json_error( [] );
458 463 }
459 464 $ids = array_map( 'intval', $_POST['id'] );
460 - $source_name = ! empty( $_POST['source_name'] ) ? sanitize_text_field( $_POST['source_name'] ) : '';
465 + $source_name = ! empty( $_POST['source_name'] ) ? sanitize_text_field( $_POST['source_name'] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash
461 466
462 467 switch ( $source_name ) {
463 468 case 'taxonomy':
464 469 $args = [
@@ -467,9 +472,11 @@
467 472 'order' => 'ASC',
468 473 'include' => implode( ',', $ids ),
469 474 ];
470 475
476 + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated
471 477 if ( $_POST['post_type'] !== 'all' ) {
478 + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated, WordPress.Security.ValidatedSanitizedInput.MissingUnslash
472 479 $args['taxonomy'] = sanitize_text_field( $_POST['post_type'] );
473 480 }
474 481
475 482 $response = wp_list_pluck( get_terms( $args ), 'name', 'term_id' );
@@ -487,9 +494,9 @@
487 494 break;
488 495 default:
489 496 $post_info = get_posts(
490 497 [
491 - 'post_type' => sanitize_text_field( $_POST['post_type'] ),
498 + 'post_type' => sanitize_text_field( $_POST['post_type'] ), // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotValidated
492 499 'include' => implode( ',', $ids ),
493 500 ]
494 501 );
495 502 $response = wp_list_pluck( $post_info, 'post_title', 'ID' );
@@ -581,10 +588,10 @@
581 588
582 589 $pro_widgets = [
583 590 [
584 591 'name' => 'rtsb-ajax-product-filters',
585 - 'title' => esc_html__( 'Ajax Product Filters', 'testimonial-slider-showcase' ),
586 - 'description' => esc_html__( 'Ajax Product Filters', 'testimonial-slider-showcase' ),
592 + 'title' => esc_html__( 'Ajax Product Filters', 'shopbuilder' ),
593 + 'description' => esc_html__( 'Ajax Product Filters', 'shopbuilder' ),
587 594 'icon' => 'rtsb-el-custom rtsb-element icon-rtsb-ajax-product-filters rtsb-promotional-element',
588 595 'categories' => '[ "rtsb-shopbuilder" ]',
589 596 ],
590 597 ];