| @@ -36,14 +36,14 @@ | ||
| 36 | 36 | public function __construct() { |
| 37 | 37 | $this->register_actions(); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - public function get( $class_name, $args ) { | |
| 41 | - $id = $class_name . '-' . wp_json_encode( $args ); | |
| 40 | + public function get( $class, $args ) { | |
| 41 | + $id = $class . '-' . wp_json_encode( $args ); | |
| 42 | 42 | |
| 43 | 43 | if ( ! isset( $this->files[ $id ] ) ) { |
| 44 | 44 | // Create an instance from dynamic args length. |
| 45 | - $reflection_class = new \ReflectionClass( $class_name ); | |
| 45 | + $reflection_class = new \ReflectionClass( $class ); | |
| 46 | 46 | $this->files[ $id ] = $reflection_class->newInstanceArgs( $args ); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | return $this->files[ $id ]; |
| @@ -192,10 +192,8 @@ | ||
| 192 | 192 | |
| 193 | 193 | add_action( 'update_option_siteurl', function () { |
| 194 | 194 | $this->reset_assets_data(); |
| 195 | 195 | } ); |
| 196 | - | |
| 197 | - add_action( 'rest_api_init', [ $this, 'register_endpoints' ] ); | |
| 198 | 196 | } |
| 199 | 197 | |
| 200 | 198 | /** |
| 201 | 199 | * Reset Assets Data. |
| @@ -260,20 +258,6 @@ | ||
| 260 | 258 | * |
| 261 | 259 | * @since 3.25.0 |
| 262 | 260 | */ |
| 263 | 261 | do_action( 'elementor/core/files/after_generate_css' ); |
| 264 | - } | |
| 265 | - | |
| 266 | - public function register_endpoints() { | |
| 267 | - register_rest_route( | |
| 268 | - 'elementor/v1', | |
| 269 | - '/cache', | |
| 270 | - [ | |
| 271 | - 'methods' => \WP_REST_Server::DELETABLE, | |
| 272 | - 'callback' => [ $this, 'clear_cache' ], | |
| 273 | - 'permission_callback' => function() { | |
| 274 | - return current_user_can( 'manage_options' ); | |
| 275 | - }, | |
| 276 | - ] | |
| 277 | - ); | |
| 278 | 262 | } |
| 279 | 263 | } |