foreach ( $image_size_names as $image_size_slug =>
$image_size_name ) { $available_image_sizes[] = array
( 'slug' =>
$image_size_slug,
'name' =>
$image_size_name,
);
} $default_size =
get_option( 'image_default_size', 'large'
);
$image_default_size =
in_array( $default_size,
array_keys( $image_size_names ), true
) ?
$default_size : 'large';
$image_dimensions = array
();
$all_sizes =
wp_get_registered_image_subsizes();
foreach ( $available_image_sizes as $size ) { $key =
$size['slug'
];
if ( isset( $all_sizes[ $key ] ) ) { $image_dimensions[ $key ] =
$all_sizes[ $key ];
} } // These styles are used if the "no theme styles" options is triggered or on
// themes without their own editor styles.
$default_editor_styles_file = ABSPATH . WPINC . '/css/dist/block-editor/default-editor-styles.css';