data[ $lightbox_title_src ]; } if ( $lightbox_description_src && $image_data[ $lightbox_description_src ] ) { $attributes['description'] = $image_data[ $lightbox_description_src ]; } } return $attributes; } private function delete_custom_images( $post_id ) { $image_meta = wp_get_attachment_metadata( $post_id ); if ( ! empty( $image_meta ) && ! empty( $image_meta['sizes'] ) ) { ( new Collection( $image_meta['sizes'] ) ) ->filter( function ( $value, $key ) { return ( 0 === strpos( $key, 'elementor_custom_' ) ); } ) ->pluck( 'file' ) ->each( function ( $path ) { $base_dir = wp_get_upload_dir()['basedir']; wp_delete_file( $base_dir . '/' . $path ); } ); } } /** * Images manager constructor. * * Initializing Elementor images manager. * * @since 1.0.0 * @access public */ public function __construct() { add_action( 'wp_ajax_elementor_get_images_details', [ $this, 'get_images_details' ] ); // Delete elementor thumbnail files on deleting its main image. add_action( 'delete_attachment', function ( $post_id ) { $this->delete_custom_images( $post_id ); } ); } }
Fatal error: Uncaught Error: Class "Elementor\Images_Manager" not found in /htdocs/wp-content/plugins/elementor/includes/plugin.php:735 Stack trace: #0 /htdocs/wp-content/plugins/elementor/includes/plugin.php(647): Elementor\Plugin->init_components() #1 /htdocs/wp-includes/class-wp-hook.php(324): Elementor\Plugin->init('') #2 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #3 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #4 /htdocs/wp-settings.php(704): do_action('init') #5 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #6 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #7 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #8 /htdocs/index.php(17): require('/htdocs/wp-blog...') #9 {main} thrown in /htdocs/wp-content/plugins/elementor/includes/plugin.php on line 735