WordPress.org

Make WordPress Core

Ticket #17470: 17470.2.diff

File 17470.2.diff, 1.7 KB (added by helen, 6 years ago)
  • src/wp-admin/edit-form-advanced.php

     
    4545$user_ID = isset($user_ID) ? (int) $user_ID : 0;
    4646$action = isset($action) ? $action : '';
    4747
     48$posts_page = false;
     49
     50if ( $post_ID == get_option( 'page_for_posts' ) && empty( $post->post_content ) ) {
     51        $posts_page = true;
     52        remove_post_type_support( $post_type, 'editor' );
     53}
     54
    4855$thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' );
    4956if ( ! $thumbnail_support && 'attachment' === $post_type && $post->post_mime_type ) {
    5057        if ( 0 === strpos( $post->post_mime_type, 'audio/' ) ) {
     
    556563</tr></tbody></table>
    557564
    558565</div>
    559 <?php }
     566<?php } elseif ( $posts_page ) {
     567?>
     568<div class="notice notice-warning"><p>You are currently editing the page that shows your latest posts.</p></div>
     569<?php
     570}
     571
    560572/**
    561573 * Fires after the content editor.
    562574 *
  • src/wp-admin/includes/meta-boxes.php

     
    739739<?php
    740740                } // end empty pages check
    741741        } // end hierarchical check.
    742         if ( 'page' == $post->post_type && 0 != count( get_page_templates( $post ) ) ) {
     742        if ( 'page' == $post->post_type && 0 != count( get_page_templates( $post ) ) && get_option( 'page_for_posts' ) != $post->ID ) {
    743743                $template = !empty($post->page_template) ? $post->page_template : false;
    744744                ?>
    745745<p><strong><?php _e('Template') ?></strong></p>