wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



wp_get_sidebar › WordPress Function

Od5.9.0
Przestarzałyn/a
wp_get_sidebar ( $id )
Parametry:
  • (string) $id The sidebar ID.
    Wymagane: Tak
Powrót:
  • (array|null) The discovered sidebar, or null if it is not registered.
Zdefiniowane na:
Codex:

Retrieves the registered sidebar with the given ID.



Źródło

function wp_get_sidebar( $id ) {
	global $wp_registered_sidebars;

	foreach ( (array) $wp_registered_sidebars as $sidebar ) {
		if ( $sidebar['id'] === $id ) {
			return $sidebar;
		}
	}

	if ( 'wp_inactive_widgets' === $id ) {
		return array(
			'id'   => 'wp_inactive_widgets',
			'name' => __( 'Inactive widgets' ),
		);
	}

	return null;
}