Changeset 51216 for trunk/src/wp-includes/class-wp-widget-factory.php
- Timestamp:
- 06/23/2021 01:33:20 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-widget-factory.php
r50995 r51216 113 113 */ 114 114 public function get_widget_object( $id_base ) { 115 foreach ( $this->widgets as $widget_object ) { 115 $key = $this->get_widget_key( $id_base ); 116 if ( '' === $key ) { 117 return null; 118 } 119 120 return $this->widgets[ $key ]; 121 } 122 123 /** 124 * Returns the registered key for the given widget type. 125 * 126 * @since 5.8.0 127 * 128 * @param string $id_base Widget type ID. 129 * @return string 130 */ 131 public function get_widget_key( $id_base ) { 132 foreach ( $this->widgets as $key => $widget_object ) { 116 133 if ( $widget_object->id_base === $id_base ) { 117 return $ widget_object;134 return $key; 118 135 } 119 136 } 120 137 121 return null;138 return ''; 122 139 } 123 140 }
Note: See TracChangeset
for help on using the changeset viewer.