Make WordPress Core


Ignore:
Timestamp:
06/08/2021 10:37:34 PM (3 years ago)
Author:
whyisjake
Message:

Editor: Ensure that the block editor can be used on the page post type.

Additionally, add a notice for when you are editing the "latest posts" page.

Fixes #45537.

Props cameronjonesweb, swissspidy, hannahmalcolm, Fantasy1125, ArnaudBan, grantmkin, youknowriad, knutsp, SergeyBiryukov, audrasjb, whyisjake.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/template.php

    r51011 r51116  
    26752675    echo '<div class="notice notice-warning inline"><p>' . __( 'You are currently editing the page that shows your latest posts.' ) . '</p></div>';
    26762676}
     2677
     2678/**
     2679 * Output a notice when editing the page for posts in the block editor (internal use only).
     2680 *
     2681 * @ignore
     2682 * @since 5.8.0
     2683 */
     2684function _wp_block_editor_posts_page_notice() {
     2685    wp_add_inline_script(
     2686        'wp-notices',
     2687        sprintf(
     2688            'wp.data.dispatch( "core/notices" ).createWarningNotice( "%s", { isDismissible: false } )',
     2689            __( 'You are currently editing the page that shows your latest posts.' )
     2690        ),
     2691        'after'
     2692    );
     2693}
Note: See TracChangeset for help on using the changeset viewer.