wpseek.com
WordPress开发者和主题制作者的搜索引擎
wp_normalize_remote_block_pattern is private and should not be used in themes or plugins directly.
wp_normalize_remote_block_pattern › WordPress Function
Since6.2.0
已弃用n/a
› wp_normalize_remote_block_pattern ( $pattern )
| 访问: |
|
| 参数: |
|
| 返回: |
|
| 定义在: |
|
| 文档: |
Normalize the pattern properties to camelCase.
The API's format is snake_case,register_block_pattern() expects camelCase.源码
function wp_normalize_remote_block_pattern( $pattern ) {
if ( isset( $pattern['block_types'] ) ) {
$pattern['blockTypes'] = $pattern['block_types'];
unset( $pattern['block_types'] );
}
if ( isset( $pattern['viewport_width'] ) ) {
$pattern['viewportWidth'] = $pattern['viewport_width'];
unset( $pattern['viewport_width'] );
}
return (array) $pattern;
}