wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_get_media_library_upload_settings › WordPress Function

Since7.2.0
Deprecatedn/a
› wp_get_media_library_upload_settings ( No parameters )
Returns:
  • (array<string,mixed>) Settings for the client-side media processing pipeline.
Defined at:
Codex:

Returns the settings for the client-side media processing pipeline in the Media Library.

These mirror the values the block editor consumes for the same pipeline: the REST index (the image processing settings, shared through _wp_get_client_side_media_image_settings()) and get_block_editor_settings() (max upload size and allowed mime types).


Source

function wp_get_media_library_upload_settings(): array {
	$image_settings = _wp_get_client_side_media_image_settings();

	return array(
		'maxUploadFileSize'             => max( 0, (int) wp_max_upload_size() ),
		'allowedMimeTypes'              => get_allowed_mime_types(),
		'allImageSizes'                 => $image_settings['image_sizes'],
		'bigImageSizeThreshold'         => $image_settings['image_size_threshold'],
		'imageStripMeta'                => $image_settings['image_strip_meta'],
		'imageMaxBitDepth'              => $image_settings['image_max_bit_depth'],
		'generateAnimatedImageSubsizes' => $image_settings['generate_animated_image_subsizes'],
	);
}