wpseek.com
WordPress开发者和主题制作者的搜索引擎



wp_get_root_state_style › WordPress Function

Since7.1.0
已弃用n/a
› wp_get_root_state_style ( $state_style, $nested_keys )
参数: (2)
  • (array) $state_style State style object.
    Required: Yes
  • (array) $nested_keys Keys to remove from the root style object.
    Required: Yes
返回:
  • (array) Root-only style object.
定义在:
文档:

Returns a style object with nested state keys removed.



源码

function wp_get_root_state_style( $state_style, $nested_keys ) {
	if ( ! is_array( $state_style ) ) {
		return $state_style;
	}

	$root_style = $state_style;
	foreach ( $nested_keys as $key ) {
		unset( $root_style[ $key ] );
	}

	return $root_style;
}