WordPress.org

Make WordPress Core

Opened 16 months ago

Closed 16 months ago

Last modified 16 months ago

#23031 closed defect (bug) (duplicate)

Notices when default post type "post" has been disabled

Reported by: dannydehaan Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: has-patch
Focuses: Cc:

Description

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' );

Attachments (1)

23031.diff (4.3 KB) - added by dannydehaan 16 months ago.
23031

Download all attachments as: .zip

Change History (4)

dannydehaan16 months ago

23031

comment:1 dannydehaan16 months ago

  • Cc d.dehaan@… added
  • Keywords has-patch added

Deleted the first patch, made a diff from master instead of 3.5-branch

comment:2 SergeyBiryukov16 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #19590.

Note: See TracTickets for help on using tickets.