wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
wp_get_global_styles › WordPress Function
Seit5.9.0
Veraltetn/v
› wp_get_global_styles ( $path = array(), $context = array() )
Parameter: (2) |
|
Gibt zurück: |
|
Definiert in: |
|
Codex: | |
Changelog: |
|
Gets the styles resulting of merging core, theme, and user data.
Quellcode
function wp_get_global_styles( $path = array(), $context = array() ) { if ( ! empty( $context['block_name'] ) ) { $path = array_merge( array( 'blocks', $context['block_name'] ), $path ); } $origin = 'custom'; if ( isset( $context['origin'] ) && 'base' === $context['origin'] ) { $origin = 'theme'; } $resolve_variables = isset( $context['transforms'] ) && is_array( $context['transforms'] ) && in_array( 'resolve-variables', $context['transforms'], true ); $merged_data = WP_Theme_JSON_Resolver::get_merged_data( $origin ); if ( $resolve_variables ) { $merged_data = WP_Theme_JSON::resolve_variables( $merged_data ); } $styles = $merged_data->get_raw_data()['styles']; return _wp_array_get( $styles, $path, $styles ); }