| @@ -6,9 +6,9 @@ | ||
| 6 | 6 | use Elementor\Core\Common\Modules\Ajax\Module as Ajax; |
| 7 | 7 | use Elementor\Plugin; |
| 8 | 8 | |
| 9 | 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | - exit; // Exit if accessed directly. | |
| 10 | + exit; // Exit if accessed directly | |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | 14 | * Finder Module |
| @@ -82,16 +82,10 @@ | ||
| 82 | 82 | * |
| 83 | 83 | * @param array $data |
| 84 | 84 | * |
| 85 | 85 | * @return array |
| 86 | - * | |
| 87 | - * @throws \Exception If finder category registration fails or validation errors occur. | |
| 88 | 86 | */ |
| 89 | 87 | public function ajax_get_category_items( array $data ) { |
| 90 | - if ( ! current_user_can( 'manage_options' ) ) { | |
| 91 | - throw new \Exception( 'Access denied.' ); | |
| 92 | - } | |
| 93 | - | |
| 94 | 88 | $category = $this->categories_manager->get_categories( $data['category'] ); |
| 95 | 89 | |
| 96 | 90 | return $category->get_category_items( $data ); |
| 97 | 91 | } |
| @@ -112,21 +106,14 @@ | ||
| 112 | 106 | foreach ( $categories as $category_name => $category ) { |
| 113 | 107 | $categories_data[ $category_name ] = array_merge( $category->get_settings(), [ 'name' => $category_name ] ); |
| 114 | 108 | } |
| 115 | 109 | |
| 116 | - /** | |
| 117 | - * Finder categories. | |
| 118 | - * | |
| 119 | - * Filters the list of finder categories. This hook is used to manage Finder | |
| 120 | - * categories - to add new categories, remove and edit existing categories. | |
| 121 | - * | |
| 122 | - * @since 2.3.0 | |
| 123 | - * | |
| 124 | - * @param array $categories_data A list of finder categories. | |
| 125 | - */ | |
| 126 | 110 | $categories_data = apply_filters( 'elementor/finder/categories', $categories_data ); |
| 127 | 111 | |
| 128 | 112 | return [ |
| 129 | 113 | 'data' => $categories_data, |
| 114 | + 'i18n' => [ | |
| 115 | + 'finder' => __( 'Finder', 'elementor' ), | |
| 116 | + ], | |
| 130 | 117 | ]; |
| 131 | 118 | } |
| 132 | 119 | } |