Input JSON schema. * @since 1.2.0 */ protected function edit_input_schema(): array { $properties = $this->common_properties(); $properties['block'] = $this->block_property(); return [ 'type' => 'object', 'properties' => $properties, 'required' => [ 'id', 'path', 'block' ], ]; } /** * Apply the edit to the tree. * * @param BlockTreeEditor $editor Tree editor. * @param array $tree Parsed block tree. * @param array $args Ability input. * @return array|WP_Error New tree, or an error. * @since 1.2.0 */ protected function apply( BlockTreeEditor $editor, array $tree, array $args ): array|WP_Error { $built = $this->build_block_or_error( $args ); if ( $built instanceof WP_Error ) { return $built; } return $editor->edit( $tree, $this->read_path( $args ), $built, $this->read_expect( $args ) ); } }