wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



wp_get_root_state_style › WordPress Function

Depuis7.1.0
Dépréciéen/a
› wp_get_root_state_style ( $state_style, $nested_keys )
Paramètres: (2)
  • (array) $state_style State style object.
    Requis: Oui
  • (array) $nested_keys Keys to remove from the root style object.
    Requis: Oui
Retourne:
  • (array) Root-only style object.
Défini(e) dans:
Codex:

Returns a style object with nested state keys removed.



Source

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;
}