wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



wp_get_media_library_upload_settings › WordPress Function

Od7.2.0
Przestarzałyn/a
› wp_get_media_library_upload_settings ( Brak parametrów )
Powrót:
  • (array<string,mixed>) Settings for the client-side media processing pipeline.
Zdefiniowane na:
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).


Źródło

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'],
	);
}