Skip to content

Editor: Set new default rendering mode for Pages #8123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
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
5 changes: 5 additions & 0 deletions src/wp-includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ function create_initial_post_types() {
)
);

// Enhance page editor for block themes by rendering template and content blocks.
if ( wp_is_block_theme() && current_theme_supports( 'block-templates' ) ) {
add_post_type_support( 'page', 'editor', array( 'default-mode' => 'template-locked' ) );
}

register_post_type(
'attachment',
array(
Expand Down
28 changes: 18 additions & 10 deletions tests/phpunit/tests/option/networkOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,14 +381,18 @@ public function test_delete_network_option_does_not_use_network_notoptions_cache
* @covers ::get_network_option
*/
public function test_get_network_option_does_not_use_single_site_notoptions_cache_for_networks() {
$network_notoptions_cache_before = wp_cache_get( '1:notoptions', 'site-options' );
$single_site_notoptions_cache_before = wp_cache_get( 'notoptions', 'options' );

get_network_option( 1, 'ticket_61730_notoption' );

$network_notoptions_cache = wp_cache_get( '1:notoptions', 'site-options' );
$single_site_notoptions_cache = wp_cache_get( 'notoptions', 'options' );
$network_notoptions_cache_after = wp_cache_get( '1:notoptions', 'site-options' );
$single_site_notoptions_cache_after = wp_cache_get( 'notoptions', 'options' );

$this->assertEmpty( $single_site_notoptions_cache, 'Single site notoptions cache should not be set for multisite installs.' );
$this->assertIsArray( $network_notoptions_cache, 'Multisite notoptions cache should be set.' );
$this->assertArrayHasKey( 'ticket_61730_notoption', $network_notoptions_cache, 'The option should be in the notoptions cache.' );
$this->assertSame( $single_site_notoptions_cache_before, $single_site_notoptions_cache_after, 'Single site notoptions cache should not change for multisite installs.' );
$this->assertNotSame( $network_notoptions_cache_before, $network_notoptions_cache_after, 'Multisite notoptions cache should change.' );
$this->assertIsArray( $network_notoptions_cache_after, 'Multisite notoptions cache should be set.' );
$this->assertArrayHasKey( 'ticket_61730_notoption', $network_notoptions_cache_after, 'The option should be in the notoptions cache.' );
}

/**
Expand All @@ -402,14 +406,18 @@ public function test_get_network_option_does_not_use_single_site_notoptions_cach
* @covers ::delete_network_option
*/
public function test_delete_network_option_does_not_use_single_site_notoptions_cache_for_networks() {
$network_notoptions_cache_before = wp_cache_get( '1:notoptions', 'site-options' );
$single_site_notoptions_cache_before = wp_cache_get( 'notoptions', 'options' );

add_network_option( 1, 'ticket_61730_notoption', 'value' );
delete_network_option( 1, 'ticket_61730_notoption' );

$network_notoptions_cache = wp_cache_get( '1:notoptions', 'site-options' );
$single_site_notoptions_cache = wp_cache_get( 'notoptions', 'options' );
$network_notoptions_cache_after = wp_cache_get( '1:notoptions', 'site-options' );
$single_site_notoptions_cache_after = wp_cache_get( 'notoptions', 'options' );

$this->assertEmpty( $single_site_notoptions_cache, 'Single site notoptions cache should not be set for multisite installs.' );
$this->assertIsArray( $network_notoptions_cache, 'Multisite notoptions cache should be set.' );
$this->assertArrayHasKey( 'ticket_61730_notoption', $network_notoptions_cache, 'The option should be in the notoptions cache.' );
$this->assertSame( $single_site_notoptions_cache_before, $single_site_notoptions_cache_after, 'Single site notoptions cache should not change for multisite installs.' );
$this->assertNotSame( $network_notoptions_cache_before, $network_notoptions_cache_after, 'Multisite notoptions cache should change.' );
$this->assertIsArray( $network_notoptions_cache_after, 'Multisite notoptions cache should be set.' );
$this->assertArrayHasKey( 'ticket_61730_notoption', $network_notoptions_cache_after, 'The option should be in the notoptions cache.' );
}
}
Loading