Changeset 48117 for trunk/src/wp-admin/includes/post.php
- Timestamp:
- 06/22/2020 10:24:42 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/post.php
r47875 r48117 2235 2235 $block_registry = WP_Block_Type_Registry::get_instance(); 2236 2236 $blocks = array(); 2237 $keys_to_pick = array( 'title', 'description', 'icon', 'category', 'keywords', 'parent', 'supports', 'attributes', 'styles', 'textdomain', 'example' ); 2237 $fields_to_pick = array( 2238 'title' => 'title', 2239 'description' => 'description', 2240 'icon' => 'icon', 2241 'category' => 'category', 2242 'keywords' => 'keywords', 2243 'parent' => 'parent', 2244 'supports' => 'supports', 2245 'attributes' => 'attributes', 2246 'provides_context' => 'providesContext', 2247 'uses_context' => 'usesContext', 2248 'styles' => 'styles', 2249 'textdomain' => 'textdomain', 2250 'example' => 'example', 2251 ); 2238 2252 2239 2253 foreach ( $block_registry->get_all_registered() as $block_name => $block_type ) { 2240 foreach ( $ keys_to_pick as$key ) {2241 if ( ! isset( $block_type->{ $ key} ) ) {2254 foreach ( $fields_to_pick as $field => $key ) { 2255 if ( ! isset( $block_type->{ $field } ) ) { 2242 2256 continue; 2243 2257 } … … 2247 2261 } 2248 2262 2249 $blocks[ $block_name ][ $key ] = $block_type->{ $ key};2263 $blocks[ $block_name ][ $key ] = $block_type->{ $field }; 2250 2264 } 2251 2265 }
Note: See TracChangeset
for help on using the changeset viewer.