diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 912432fbaa..295b96a8f3 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -45,6 +45,11 @@ $post_ID = isset($post_ID) ? (int) $post_ID : 0; $user_ID = isset($user_ID) ? (int) $user_ID : 0; $action = isset($action) ? $action : ''; +if ( $post_ID == get_option( 'page_for_posts' ) && empty( $post->post_content ) ) { + add_action( 'edit_form_after_title', '_wp_posts_page_notice' ); + remove_post_type_support( $post_type, 'editor' ); +} + $thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' ); if ( ! $thumbnail_support && 'attachment' === $post_type && $post->post_mime_type ) { if ( 0 === strpos( $post->post_mime_type, 'audio/' ) ) { diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php index b99f30cc8f..acd84c30c1 100644 --- a/wp-admin/includes/meta-boxes.php +++ b/wp-admin/includes/meta-boxes.php @@ -739,7 +739,7 @@ function page_attributes_meta_box($post) { post_type && 0 != count( get_page_templates( $post ) ) ) { + if ( 'page' == $post->post_type && 0 != count( get_page_templates( $post ) ) && get_option( 'page_for_posts' ) != $post->ID ) { $template = !empty($post->page_template) ? $post->page_template : false; ?>
diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index c1e362b5a3..8975e03110 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -2169,3 +2169,12 @@ function wp_star_rating( $args = array() ) { echo str_repeat( '', $empty_stars); echo ''; } + +/** + * Output a notice when editing the page for posts. + * + * @since 4.2.0 + */ +function _wp_posts_page_notice() { + echo '
' . __( 'You are currently editing the page that shows your latest posts.' ) . '