Skip to content

Commit

Permalink
Revert to context
Browse files Browse the repository at this point in the history
  • Loading branch information
noahtallen committed Jun 17, 2020
1 parent 091b02c commit 1912fe4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/class-wp-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ public function __construct( $block, $available_context = array(), $registry = n

$this->available_context = $available_context;

if ( ! empty( $this->block_type->usesContext ) ) {
foreach ( $this->block_type->usesContext as $context_name ) {
if ( ! empty( $this->block_type->context ) ) {
foreach ( $this->block_type->context as $context_name ) {
if ( array_key_exists( $context_name, $this->available_context ) ) {
$this->context[ $context_name ] = $this->available_context[ $context_name ];
}
Expand Down
2 changes: 1 addition & 1 deletion lib/compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function register_block_type_from_metadata( $file_or_folder, $args = array() ) {
$property_mappings = array(
'title' => 'title',
'category' => 'category',
'context' => 'usesContext',
'context' => 'context',
'providesContext' => 'providesContext',
'parent' => 'parent',
'icon' => 'icon',
Expand Down

0 comments on commit 1912fe4

Please sign in to comment.