| @@ -69,13 +69,13 @@ | ||
| 69 | 69 | add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'editor_scripts' ] ); |
| 70 | 70 | // add_action( 'template_redirect', [ $this, 'both_builder_frontend' ], 99 ); |
| 71 | 71 | |
| 72 | 72 | // 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' ] ); | |
| 73 | + add_action( 'wp_ajax_rtsb_select2_object_search', [ $this, 'select2_ajax_posts_filter_autocomplete' ] ); | |
| 74 | + add_action( 'wp_ajax_nopriv_rtsb_select2_object_search', [ $this, 'select2_ajax_posts_filter_autocomplete' ] ); | |
| 75 | 75 | // 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' ] ); | |
| 76 | + add_action( 'wp_ajax_rtsb_select2_get_title', [ $this, 'select2_ajax_get_posts_value_titles' ] ); | |
| 77 | + add_action( 'wp_ajax_nopriv_rtsb_select2_get_title', [ $this, 'select2_ajax_get_posts_value_titles' ] ); | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | 81 | * Apply for frontend. |
| @@ -108,12 +108,15 @@ | ||
| 108 | 108 | * @return void |
| 109 | 109 | */ |
| 110 | 110 | public function add_elementor_widget_categories( $elements_manager ) { |
| 111 | 111 | $categories = []; |
| 112 | - $type = BuilderFns::builder_type( get_the_ID() ); | |
| 112 | + $builder_id = get_queried_object_id(); | |
| 113 | + $id = Fns::wpml_object_id( $builder_id, BuilderFns::$post_type_tb, 'default' ); | |
| 114 | + $type = BuilderFns::builder_type( $id ); | |
| 115 | + | |
| 113 | 116 | if ( $type ) { |
| 114 | 117 | $builder_type = ! empty( BuilderFns::builder_page_types()[ $type ] ) ? BuilderFns::builder_page_types()[ $type ] : ''; |
| 115 | - $builder_type = str_replace( 'My Account - ', '', $builder_type ); | |
| 118 | + $builder_type = str_replace( [ 'My Account - ', 'Endpoint: ' ], '', $builder_type ); | |
| 116 | 119 | $categories['rtsb-shopbuilder'] = [ |
| 117 | 120 | 'title' => esc_html__( 'ShopBuilder', 'shopbuilder' ) . ' - ' . ucfirst( $builder_type ), |
| 118 | 121 | 'icon' => 'fa fa-plug', |
| 119 | 122 | ]; |
| @@ -123,9 +126,10 @@ | ||
| 123 | 126 | 'title' => esc_html__( 'Shopbuilder - General', 'shopbuilder' ), |
| 124 | 127 | 'icon' => 'fa fa-plug', |
| 125 | 128 | ]; |
| 126 | 129 | } |
| 127 | - $categories = apply_filters( 'rtsb_elementor_widgets_category_lists', $categories ); | |
| 130 | + $categories = apply_filters( 'rtsb_elementor_widgets_category_lists', $categories ); | |
| 131 | + | |
| 128 | 132 | $other_categories = $elements_manager->get_categories(); |
| 129 | 133 | $categories = array_merge( |
| 130 | 134 | array_slice( $other_categories, 0, 1 ), |
| 131 | 135 | $categories, |
| @@ -226,9 +230,9 @@ | ||
| 226 | 230 | * |
| 227 | 231 | * @return array |
| 228 | 232 | */ |
| 229 | 233 | public function rtsb_icons( $tabs = [] ) { |
| 230 | - $custom_icons = $this->get_icons(); | |
| 234 | + $custom_icons = Fns::get_custom_icon_names(); | |
| 231 | 235 | |
| 232 | 236 | $tabs['shopbuilder-icons'] = [ |
| 233 | 237 | 'name' => 'rtsb-fonts', |
| 234 | 238 | 'label' => esc_html__( 'ShopBuilder Icons', 'shopbuilder' ), |
| @@ -581,10 +585,10 @@ | ||
| 581 | 585 | |
| 582 | 586 | $pro_widgets = [ |
| 583 | 587 | [ |
| 584 | 588 | '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' ), | |
| 589 | + 'title' => esc_html__( 'Ajax Product Filters', 'shopbuilder' ), | |
| 590 | + 'description' => esc_html__( 'Ajax Product Filters', 'shopbuilder' ), | |
| 587 | 591 | 'icon' => 'rtsb-el-custom rtsb-element icon-rtsb-ajax-product-filters rtsb-promotional-element', |
| 588 | 592 | 'categories' => '[ "rtsb-shopbuilder" ]', |
| 589 | 593 | ], |
| 590 | 594 | ]; |