Changeset 48117
- Timestamp:
- 06/22/2020 10:24:42 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 3 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 ( $ $key ) { 2255 if ( ! isset( $block_type->{ $ } ) ) { 2242 2256 continue; 2243 2257 } … … 2247 2261 } 2248 2262 2249 $blocks[ $block_name ][ $key ] = $block_type->{ $ key};2263 $blocks[ $block_name ][ $key ] = $block_type->{ $ }; 2250 2264 } 2251 2265 } -
trunk/src/wp-includes/class-wp-block-type.php
r48110 r48117 75 75 /** 76 76 * @since 5.5.0 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 77 107 * @var array 78 108 */ 79 public $supports = array(); 80 81 /** 82 * @since 5.5.0 83 * @var array|null 84 */ 85 public $example = null; 86 87 /** 88 * Block type render callback. 89 * 90 * @since 5.0.0 91 * @var callable 92 */ 93 public $render_callback = null; 94 95 /** 96 * Block type attributes property schemas. 97 * 98 * @since 5.0.0 99 * @var array|null 100 */ 101 public $attributes = null; 109 public $uses_context = array(); 110 111 /** 112 * Context provided by blocks of this type. 113 * 114 * @since 5.5.0 115 * @var array|null 116 */ 117 public $provides_context = null; 102 118 103 119 /** -
trunk/tests/phpunit/tests/admin/includesPost.php
r47876 r48117 845 845 'icon' => 'text', 846 846 'keywords' => array(), 847 ' supports'=> array(),847 ' => array(), 848 848 'styles' => array(), 849 849 ),
Note: See TracChangeset
for help on using the changeset viewer.