Skip to content

Instantly share code, notes, and snippets.

@benhuson
Created November 17, 2015 16:20
Show Gist options
  • Select an option

  • Save benhuson/cd1fc54edbe53eef4b60 to your computer and use it in GitHub Desktop.

Select an option

Save benhuson/cd1fc54edbe53eef4b60 to your computer and use it in GitHub Desktop.

Revisions

  1. benhuson created this gist Nov 17, 2015.
    26 changes: 26 additions & 0 deletions remove_posts_page_admin_notice.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    <?php

    /**
    * Remove Posts Page Admin Notice
    *
    * Since WordPress 4.2, if you edit the page used as the Posts page
    * and there was no content saved for that page, the editor functionality
    * is removed and a message displayed instead.
    *
    * The following function re-enables the editor on this page.
    * Uncomment the remove_action line below if you want to remove
    * the admin message too.
    *
    * @param WP_Post $post Post object
    */
    function remove_posts_page_admin_notice( $post ) {

    if ( $post->ID == get_option( 'page_for_posts' ) ) {
    //remove_action( 'edit_form_after_title', '_wp_posts_page_notice' );
    add_post_type_support( get_post_type( $post ), 'editor' );
    }

    }
    add_action( 'add_meta_boxes_page', 'remove_posts_page_admin_notice' );

    ?>