wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
wp_get_global_settings › WordPress Function
Seit5.9.0
Veraltetn/v
› wp_get_global_settings ( $path = array(), $context = array() )
| Parameter: (2) |
|
| Gibt zurück: |
|
| Definiert in: |
|
| Codex: | |
| Changelog: |
|
Gets the settings resulting of merging core, theme, and user data.
Ähnliche Funktionen: wp_get_global_styles, wp_get_global_stylesheet, wp_set_all_user_settings, get_settings, get_all_user_settings
Quellcode
function wp_get_global_settings( $path = array(), $context = array() ) {
if ( ! empty( $context['block_name'] ) ) {
$new_path = array( 'blocks', $context['block_name'] );
foreach ( $path as $subpath ) {
$new_path[] = $subpath;
}
$path = $new_path;
}
// This is the default value when no origin is provided or when it is 'all'.
$origin = 'custom';
if ( isset( $context['origin'] ) && 'base' === $context['origin'] ) {
$origin = 'theme';
}
$settings = WP_Theme_JSON_Resolver::get_merged_data( $origin )->get_settings();
return _wp_array_get( $settings, $path, $settings );
}