Opened 10 years ago
Closed 10 years ago
#34446 closed defect (bug) (fixed)
WordPress Notice after add support for post type archives in menu
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.4.1 | Priority: | normal |
| Severity: | normal | Version: | 4.4 |
| Component: | Menus | Keywords: | fixed-major |
| Focuses: | Cc: |
Description
I have notice:
Notice: Undefined property: stdClass::$post_parent in wp-includes\class-wp-walker.php on line 218
I have error in CPT meta box in second tab ("See all"). I use WordPress 4.4-beta1-35395
Attachments (2)
Change History (10)
#2
@
10 years ago
register_post_type( 'news', array(
'label' => 'News',
'labels' => array(
'name' => 'News',
'singular_name' => 'News',
'menu_name' => 'News',
'name_admin_bar' => 'News',
'parent_item_colon' => 'Parent news:',
'all_items' => 'All news',
'add_new_item' => 'Add new item',
'add_new' => 'Add new',
'new_item' => 'New Item',
'edit_item' => 'Edit item',
'update_item' => 'Update item',
'view_item' => 'View item',
'search_items' => 'Search items',
'not_found' => 'Not Found',
'not_found_in_trash' => 'Not found in trash',
),
'supports' => array(
'title',
'editor',
'excerpt',
'author',
'thumbnail',
'comments',
'trackbacks',
'revisions',
'custom-fields',
'post-formats',
),
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-update',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => 'news',
'exclude_from_search' => false,
'publicly_queryable' => true,
'rewrite' => array(
'slug' => 'news',
'with_front' => true,
'pages' => true,
'feeds' => true,
),
'capability_type' => 'page',
) );
#3
@
10 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to 4.4.1
- Version set to 4.4
I'm seeing this too. Minimum code to reproduce:
register_post_type( 'foo', [ 'hierarchical' => true, 'public' => true, 'has_archive' => true, ] );
#6
@
10 years ago
- Owner set to johnbillion
- Resolution set to fixed
- Status changed from new to closed
In 35876:
Note: See
TracTickets for help on using
tickets.
Hey there
Would you mind sharing the code you're using?
Not sure if you're using a custom post type or extending the built-in menu post type. Changing behaviour of built-in post types can lead to unexpected results and is not really supported.