[wp-trac] [WordPress Trac] #23031: Notices when default post type "post" has been disabled

WordPress Trac noreply at wordpress.org
Thu Dec 20 21:26:03 UTC 2012


#23031: Notices when default post type "post" has been disabled
-----------------------------+--------------------------
 Reporter:  dannydehaan      |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  Post Types
  Version:                   |   Severity:  normal
 Keywords:                   |
-----------------------------+--------------------------
 Hi Guys,

 I'm currently updating the WordPress installation for a client, in this
 install the default post type "post" is disabled. When i updated the
 installation to 3.5, i'm getting the following Notice:
 Notice: Trying to get property of non-object in /Path/To/WordPress/wp-
 includes/admin-bar.php on line 366

 I made a fix for that one - included in the patch -, then the following
 Notices came up:
 Notice: Trying to get property of non-object in /Path/To/WordPress/wp-
 admin/menu.php on line 52
 Notice: Trying to get property of non-object in /Path/To/WordPress/wp-
 admin/index.php on line 79

 When i fixed those 2 - also included in the patch - the following notice
 came up:
 Notice: Undefined offset: 2 in /Path/To/WordPress/wp-
 admin/includes/plugin.php on line 1419

 The way the disabling of the post type is done, is the following:

 {{{
 function remove_blog_posttype() {
         global $wp_post_types;
         unset( $wp_post_types['post'] );
 }

 add_action( 'init', 'remove_blog_posttype' );
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23031>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list