apply_block_core_search_border_styles

函数
apply_block_core_search_border_styles ( $attributes, $property, $wrapper_styles, $button_styles, $input_styles )
参数
  • (array) $attributes The block attributes.
    Required:
  • (string) $property Border property to generate rule for e.g. width or color.
    Required:
  • (array) $wrapper_styles Current collection of wrapper styles.
    Required:
  • (array) $button_styles Current collection of button styles.
    Required:
  • (array) $input_styles Current collection of input styles.
    Required:
返回值
  • (void)
定义位置
相关方法
apply_block_core_search_border_styleget_block_core_post_featured_image_border_attributesrender_block_core_searchblock_core_gallery_renderget_block_editor_theme_styles
引入
-
弃用
-

apply_block_core_search_border_styles: 这个函数是一个钩子,当块编辑器渲染一个搜索块时被调用,它允许开发者将自定义的边框样式应用到搜索块上。

这为给定的边框属性添加CSS规则,例如宽度或颜色。它将规则注入所提供的包装器、按钮和输入样式数组中,用于统一的"平面"边框或那些配置了单独边框的边框。

function apply_block_core_search_border_styles( $attributes, $property, &$wrapper_styles, &$button_styles, &$input_styles ) {
	apply_block_core_search_border_style( $attributes, $property, null, $wrapper_styles, $button_styles, $input_styles );
	apply_block_core_search_border_style( $attributes, $property, 'top', $wrapper_styles, $button_styles, $input_styles );
	apply_block_core_search_border_style( $attributes, $property, 'right', $wrapper_styles, $button_styles, $input_styles );
	apply_block_core_search_border_style( $attributes, $property, 'bottom', $wrapper_styles, $button_styles, $input_styles );
	apply_block_core_search_border_style( $attributes, $property, 'left', $wrapper_styles, $button_styles, $input_styles );
}

常见问题

FAQs
查看更多 >