public function addImagesDroplist($configs)
    {
        // Add image names
        add_filter('image_size_names_choose', function ($sizes) use ($configs) {
            // New sizes array
            $new_sizes = [];

            // Iterate on sizes like:
            // @key => [@width, @height, @crop, @dropdown],
            foreach ($configs as $key => $props) {
                if (4 !== count($props)) {
                    continue;
                }

                // Extract last var
                $label = array_pop($props);

                // Check label
                if (empty($label)) {
                    continue;
                }

                // Add image sizes
                $new_sizes[$key] = $label;
            }

            return array_merge($sizes, $new_sizes);
        });
    }
public function addImagesDroplist($configs)
    {
        // Add image names
        add_filter('image_size_names_choose', function ($sizes) use ($configs) {
            // New sizes array
            $new_sizes = [];

            // Iterate on sizes like:
            // @key => [@width, @height, @crop, @dropdown],
            foreach ($configs as $key => $props) {
                if (4 !== count($props)) {
                    continue;
                }

                // Extract last var
                $label = array_pop($props);

                // Check label
                if (empty($label)) {
                    continue;
                }

                // Add image sizes
                $new_sizes[$key] = $label;
            }

            return array_merge($sizes, $new_sizes);
        });
    }
public function addImagesDroplist ( $ configs ) { // Add image names add_filter ( 'image_size_names_choose' , function ( $ sizes ) use ( $ configs ) { // New sizes array $ new_sizes = [ ] ; // Iterate on sizes like: // @key => [@width, @height, @crop, @dropdown], foreach ( $ configs as $ key => $ props ) { if ( 4 !== count ( $ props ) ) { continue ; } // Extract last var $ label = array_pop ( $ props ) ; // Check label if ( empty ( $ label ) ) { continue ; } // Add image sizes $ new_sizes [ $ key ] = $ label ; } return array_merge ( $ sizes , $ new_sizes ) ; } ) ; }
Add images names to droplist.

@param array $configs

@see https://codex.wordpress.org/Plugin_API/Filter_Reference/image_size_names_choose
Add images names to droplist .