[wp-trac] [WordPress Trac] #17470: Display warning when editing the page_for_posts page

WordPress Trac noreply at wordpress.org
Mon Jun 8 07:42:46 UTC 2015


#17470: Display warning when editing the page_for_posts page
-------------------------------+---------------------------------
 Reporter:  alexkingorg        |       Owner:  helen
     Type:  enhancement        |      Status:  closed
 Priority:  normal             |   Milestone:  4.2
Component:  Posts, Post Types  |     Version:  3.2
 Severity:  normal             |  Resolution:  fixed
 Keywords:  has-patch          |     Focuses:  ui, administration
-------------------------------+---------------------------------

Comment (by philiparthurmoore):

 For anyone else who comes across this, this following bit of code has been
 added to my themes and seems to do the trick.

 {{{
 <?php
 /**
  * Static Front Page in Dashboard
  *
  * @see     function add_action
  * @see     function add_post_type_support
  * @see     function get_option
  * @see     function remove_action
  * @package Theme_Slug
  * @since   Theme Slug 1.0
  */
 function always_enable_static_front_page_editor() {
         global $post_type, $post_ID;
         $post_ID = ! empty( $post_ID ) ? (string) $post_ID : '0';
         $page_for_posts = (string) get_option( 'page_for_posts' );
         if ( $page_for_posts !== $post_ID ) {
                 return;
         }
         remove_action( 'edit_form_after_title', '_wp_posts_page_notice' );
         add_post_type_support( $post_type, 'editor' );
 } // end function always_enable_static_front_page_editor
 add_action( 'edit_form_after_title',
 'always_enable_static_front_page_editor', 9 );
 }}}

 If there's a simpler way about this, let me know. Always open to
 suggestions.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/17470#comment:28>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list