From 091b02ca900c336d70277433c799b8966f431650 Mon Sep 17 00:00:00 2001 From: Noah Allen Date: Tue, 16 Jun 2020 10:39:43 -0700 Subject: [PATCH] Rename requiresContex to usesContext --- lib/class-wp-block.php | 4 ++-- lib/compat.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/class-wp-block.php b/lib/class-wp-block.php index a8ce8a035bd3f0..de7a11c63be761 100644 --- a/lib/class-wp-block.php +++ b/lib/class-wp-block.php @@ -107,8 +107,8 @@ public function __construct( $block, $available_context = array(), $registry = n $this->available_context = $available_context; - if ( ! empty( $this->block_type->requiresContext ) ) { - foreach ( $this->block_type->requiresContext as $context_name ) { + if ( ! empty( $this->block_type->usesContext ) ) { + foreach ( $this->block_type->usesContext as $context_name ) { if ( array_key_exists( $context_name, $this->available_context ) ) { $this->context[ $context_name ] = $this->available_context[ $context_name ]; } diff --git a/lib/compat.php b/lib/compat.php index 31129bcbf32afd..2282c784273662 100644 --- a/lib/compat.php +++ b/lib/compat.php @@ -169,7 +169,7 @@ function register_block_type_from_metadata( $file_or_folder, $args = array() ) { $property_mappings = array( 'title' => 'title', 'category' => 'category', - 'context' => 'requiresContext', + 'context' => 'usesContext', 'providesContext' => 'providesContext', 'parent' => 'parent', 'icon' => 'icon',