mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Editor: Fix a PHP notice appearing when adding a new template part.
This changeset fixes a PHP notice appearing when a template part is created in the site editor. It also adds a unit test case to cover `WP_REST_Templates_Controller::prepare_item_for_database`. Props wildworks, dunhakdis, Rahmohn, oglekler, audrasjb, mukesh27, costdev, dunhakdis. Fixes #57851. git-svn-id: https://develop.svn.wordpress.org/trunk@56248 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -596,7 +596,7 @@ class WP_REST_Templates_Controller extends WP_REST_Controller {
|
||||
$changes->tax_input['wp_template_part_area'] = _filter_block_template_part_area( $request['area'] );
|
||||
} elseif ( null !== $template && 'custom' !== $template->source && $template->area ) {
|
||||
$changes->tax_input['wp_template_part_area'] = _filter_block_template_part_area( $template->area );
|
||||
} elseif ( ! $template->area ) {
|
||||
} elseif ( empty( $template->area ) ) {
|
||||
$changes->tax_input['wp_template_part_area'] = WP_TEMPLATE_PART_AREA_UNCATEGORIZED;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user