Skip to content

Instantly share code, notes, and snippets.

@benhuson
Created November 17, 2015 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benhuson/cd1fc54edbe53eef4b60 to your computer and use it in GitHub Desktop.
Save benhuson/cd1fc54edbe53eef4b60 to your computer and use it in GitHub Desktop.
Remove WordPress Posts Page Admin Notice
<?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' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment