Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://develop.svn.wordpress.org/trunk"
},
"gutenberg": {
"sha": "efd7722f89ebb8abfc3607fffdd86f5e34afbd9c",
"sha": "c5bdc7f4898ec98114cdccbe1cacec7a979b85cc",
"ghcrRepo": "WordPress/gutenberg/gutenberg-wp-develop-build"
},
"engines": {
Expand Down
8 changes: 4 additions & 4 deletions src/wp-includes/assets/script-loader-packages.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
'wp-url',
'wp-warning'
),
'version' => 'f9a3114894c529a215ac'
'version' => 'e21efcc5c30f26ee0aba'
),
'block-library.js' => array(
'dependencies' => array(
Expand Down Expand Up @@ -151,7 +151,7 @@
'import' => 'dynamic'
)
),
'version' => '58156d96a4c9fdf86645'
'version' => '9ad7f7e62e9fbecbab34'
),
'block-serialization-default-parser.js' => array(
'dependencies' => array(
Expand Down Expand Up @@ -549,7 +549,7 @@
'import' => 'static'
)
),
'version' => '33deefc6545abe93022a'
'version' => 'c1e50b340a6f2a32176c'
),
'element.js' => array(
'dependencies' => array(
Expand Down Expand Up @@ -670,7 +670,7 @@
'wp-url',
'wp-warning'
),
'version' => 'd91937a9b82062da49eb'
'version' => '5ef0448131de57454ed0'
),
'notices.js' => array(
'dependencies' => array(
Expand Down
8 changes: 4 additions & 4 deletions src/wp-includes/assets/script-modules-packages.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
'wp-data',
'wp-i18n'
),
'version' => '9448bb3053516a39086d'
'version' => '2dfc1cc1ffd6007eaacd'
),
'block-editor/utils/fit-text-frontend.js' => array(
'dependencies' => array(
Expand Down Expand Up @@ -349,7 +349,7 @@
'import' => 'static'
)
),
'version' => '2aa2fe44937a04cb98c7'
'version' => '5a1005804ad8a5083c79'
),
'core-fields/root_site.js' => array(
'dependencies' => array(
Expand Down Expand Up @@ -466,7 +466,7 @@
'dependencies' => array(

),
'version' => 'b2185b9b3c06dcd1869d'
'version' => '0c838873c424e941c437'
),
'interactivity-router/full-page.js' => array(
'dependencies' => array(
Expand Down Expand Up @@ -494,7 +494,7 @@
'import' => 'static'
)
),
'version' => 'c0110eac0afb41d3f204'
'version' => '4555574d1243e79178f5'
),
'latex-to-mathml/index.js' => array(
'dependencies' => array(
Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/build/scripts/core-fields/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* - `last_edited_date`, for every post type.
* - `notesCount`, for the post types whose `editor` support has the `notes`
* argument.
* - `parent`, for the post types supporting `page-attributes`.
* - `parent`, for hierarchical post types supporting `page-attributes`.
* - `password`, for every post type but the design ones.
* - `ping_status`, for the post types supporting `trackbacks`.
* - `post-content-info`, for the post types supporting `editor`.
Expand Down Expand Up @@ -71,7 +71,7 @@ function wp_register_core_post_type_supports_fields() {
'format' => post_type_supports( $post_type, 'post-formats' ) && current_theme_supports( 'post-formats' ),
'last_edited_date' => true,
'notesCount' => is_array( $editor ) && (bool) array_filter( array_column( $editor, 'notes' ) ),
'parent' => post_type_supports( $post_type, 'page-attributes' ),
'parent' => is_post_type_hierarchical( $post_type ) && post_type_supports( $post_type, 'page-attributes' ),
'password' => true,
'ping_status' => post_type_supports( $post_type, 'trackbacks' ),
'post-content-info' => post_type_supports( $post_type, 'editor' ),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* The parent of a post, for the post types supporting `page-attributes`. Its
* JavaScript parts (`Edit` and `render`) are in `field.tsx`, next to this
* file.
* The parent of a post, for the hierarchical post types supporting
* `page-attributes`. Its JavaScript parts (`Edit` and `render`) are in
* `field.tsx`, next to this file.
*
* @package WordPress
*/
Expand Down
3 changes: 2 additions & 1 deletion src/wp-includes/images/icon-library/update.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ public static function data_default_fields_and_their_supports() {
return array(
'discussion' => array( 'discussion', array( 'comments', 'trackbacks' ) ),
'excerpt' => array( 'excerpt', array( 'excerpt' ) ),
'parent' => array( 'parent', array( 'page-attributes' ) ),
'ping_status' => array( 'ping_status', array( 'trackbacks' ) ),
'title' => array( 'title', array( 'title' ) ),
'post-content-info' => array( 'post-content-info', array( 'editor' ) ),
Expand Down Expand Up @@ -318,6 +317,51 @@ public function test_a_default_field_follows_its_supports( $field_id, $supports
$this->assertNotContains( $field_id, self::get_field_ids( 'test_without' ), 'A post type without the supports does not get the field.' );
}

/**
* Data provider.
*
* @return array[] Post type settings and expected parent field registration.
*/
public static function data_parent_field_requirements() {
return array(
'hierarchical with attributes' => array( true, true, true ),
'hierarchical without attributes' => array( true, false, false ),
'non-hierarchical with attributes' => array( false, true, false ),
'non-hierarchical without attributes' => array( false, false, false ),
);
}

/**
* The parent field requires both hierarchy and page attributes support.
*
* @ticket 66428
*
* @dataProvider data_parent_field_requirements
*
* @param bool $hierarchical Whether the post type is hierarchical.
* @param bool $has_attributes Whether the post type supports page attributes.
* @param bool $has_parent Whether the parent field should be registered.
*/
public function test_the_parent_field_requires_hierarchy_and_page_attributes( $hierarchical, $has_attributes, $has_parent ) {
register_post_type(
'test_parent',
array(
'show_in_rest' => true,
'hierarchical' => $hierarchical,
'supports' => $has_attributes ? array( 'page-attributes' ) : array(),
)
);

try {
self::reset_registry();
$ids = self::get_field_ids( 'test_parent' );
} finally {
unregister_post_type( 'test_parent' );
}

$this->assertSame( $has_parent, in_array( 'parent', $ids, true ) );
}

/**
* The default fields come from the `field.php` files of the
* `post_type_supports` folder.
Expand Down
Loading