query_vars; $endpointKey = Brizy_Editor::prefix( self::ENDPOINT ); $endpointFilter = Brizy_Editor::prefix( self::ENDPOINT_FILTER ); if ( empty( $vars[ $endpointKey ] ) || empty( $vars[ $endpointFilter ] ) ) { return; } session_write_close(); try { $size = html_entity_decode( $vars[ $endpointFilter ] ); $mediaCache = new Brizy_Editor_CropCacheMedia( Brizy_Editor_Project::get() ); $croppedPath = $mediaCache->crop_media( $vars[ $endpointKey ], $size ); do_action( 'brizy_before_send_asset' ); $this->send_file( $croppedPath ); } catch ( Exception $e ) { Brizy_Logger::instance()->exception( $e ); status_header( 404 ); global $wp_query; $wp_query->set_404(); return; } } }