wpseek.com
WordPress开发者和主题制作者的搜索引擎
wp_is_client_side_media_processing_enabled › WordPress Function
Since7.1.0
已弃用n/a
› wp_is_client_side_media_processing_enabled ( 没有参数 )
| 返回: |
|
| 定义在: |
|
| 文档: |
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.源码
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 );
}