Changeset 52016 for trunk/src/wp-includes/widgets.php
- Timestamp:
- 11/05/2021 02:14:07 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/widgets.php
r51850 r52016 221 221 * @since 2.2.0 222 222 * @since 5.6.0 Added the `before_sidebar` and `after_sidebar` arguments. 223 * @since 5.9.0 Added the `show_in_rest` argument. 223 224 * 224 225 * @global array $wp_registered_sidebars Registered sidebars. … … 251 252 * Outputs before the {@see 'dynamic_sidebar_after'} action. 252 253 * Default empty string. 254 * @type bool $show_in_rest Whether to show this sidebar publicly in the REST API. 255 * Defaults to only showing the sidebar to administrator users. 253 256 * } 254 257 * @return string Sidebar ID added to $wp_registered_sidebars global. … … 273 276 'before_sidebar' => '', 274 277 'after_sidebar' => '', 278 'show_in_rest' => false, 275 279 ); 276 280 … … 1037 1041 1038 1042 /** 1043 * Retrieves the registered sidebar with the given id. 1044 * 1045 * @since 5.9.0 1046 * 1047 * @global array $wp_registered_sidebars The registered sidebars. 1048 * 1049 * @param string $id The sidebar id. 1050 * @return array|null The discovered sidebar, or null if it is not registered. 1051 */ 1052 function wp_get_sidebar( $id ) { 1053 global $wp_registered_sidebars; 1054 1055 foreach ( (array) $wp_registered_sidebars as $sidebar ) { 1056 if ( $sidebar['id'] === $id ) { 1057 return $sidebar; 1058 } 1059 } 1060 1061 if ( 'wp_inactive_widgets' === $id ) { 1062 return array( 1063 'id' => 'wp_inactive_widgets', 1064 'name' => __( 'Inactive widgets' ), 1065 ); 1066 } 1067 1068 return null; 1069 } 1070 1071 /** 1039 1072 * Set the sidebar widget option to update sidebars. 1040 1073 *
Note: See TracChangeset
for help on using the changeset viewer.