wpseek.com
A WordPress-centric search engine for devs and theme authors
wp_is_client_side_media_processing_enabled › WordPress Function
Since7.1.0
Deprecatedn/a
› wp_is_client_side_media_processing_enabled ( No parameters )
| Returns: |
|
| Defined at: |
|
| Codex: |
Checks whether client-side media processing is enabled.
Client-side media processing uses the browser's capabilities to handle tasks like image resizing and compression before uploading to the server.Source
function wp_is_client_side_media_processing_enabled(): bool {
// This is due to SharedArrayBuffer requiring a secure context.
$host = strtolower( (string) strtok( $_SERVER['HTTP_HOST'] ?? '', ':' ) );
$enabled = ( is_ssl() || 'localhost' === $host || str_ends_with( $host, '.localhost' ) );
/**
* Filters whether client-side media processing is enabled.
*
* @since 7.1.0
*
* @param bool $enabled Whether client-side media processing is enabled. Default true if the page is served in a secure context.
*/
return (bool) apply_filters( 'wp_client_side_media_processing_enabled', $enabled );
}