wpseek.com
A WordPress-centric search engine for devs and theme authors
wp_set_client_side_media_processing_flag › WordPress Function
Since7.1.0
Deprecatedn/a
› wp_set_client_side_media_processing_flag ( No parameters )
| Defined at: |
|
| Codex: |
Sets a global JS variable to indicate that client-side media processing is enabled.
Source
function wp_set_client_side_media_processing_flag(): void {
if ( ! wp_is_client_side_media_processing_enabled() ) {
return;
}
wp_add_inline_script( 'wp-block-editor', 'window.__clientSideMediaProcessing = true;', 'before' );
$chromium_version = wp_get_chromium_major_version();
if ( null !== $chromium_version && $chromium_version >= 137 ) {
wp_add_inline_script( 'wp-block-editor', 'window.__documentIsolationPolicy = true;', 'before' );
}
/*
* Register the @wordpress/vips/worker script module as a dynamic dependency
* of the wp-upload-media classic script. This ensures it is included in the
* import map so that the dynamic import() in upload-media.js can resolve it.
*/
wp_scripts()->add_data(
'wp-upload-media',
'module_dependencies',
array( '@wordpress/vips/worker' )
);
}