WordPress.org

Make WordPress Core

Ticket #17470: patch.diff

File patch.diff, 1.2 KB (added by alexkingorg, 3 years ago)

Add an admin_notice when editing the page_for_posts page.

  • wp-admin/includes/post.php

     
    12841284} 
    12851285 
    12861286/** 
     1287 * Outputs the notice message to say that this page is used for posts and content will be ignored. 
     1288 * 
     1289 * @since 3.2 
     1290 * @return none 
     1291 */ 
     1292function _admin_notice_page_for_posts() { 
     1293        $message = __( 'This page is used to display a list of posts; content here will not be displayed. You can change this in your <a href="%s">Reading Settings</a>.' ); 
     1294        echo '<div class="error"><p>' . sprintf( $message, esc_url( admin_url( 'options-reading.php' ) ) ) . '</p></div>'; 
     1295} 
     1296 
     1297/** 
    12871298 * Creates autosave data for the specified post from $_POST data. 
    12881299 * 
    12891300 * @package WordPress 
  • wp-admin/post.php

     
    176176                wp_enqueue_script('autosave'); 
    177177        } 
    178178 
     179        if ( $post_id == get_option( 'page_for_posts' ) ) { 
     180                add_action( 'admin_notices', '_admin_notice_page_for_posts' ); 
     181        } 
     182 
    179183        $title = $post_type_object->labels->edit_item; 
    180184        $post = get_post_to_edit($post_id); 
    181185