WordPress.org

Make WordPress Core

Opened 6 months ago

Closed 6 months ago

Last modified 6 months ago

#22836 closed defect (bug) (invalid)

Custom taxonomy meta box does not show taxonomies attached to post inside custom post page

Reported by: guymaliar Owned by:
Priority: normal Milestone:
Component: General Version: 3.5
Severity: normal Keywords:
Cc:

Description (last modified by nacin)

When registering a custom post type and registering a custom taxonomy to that post type.
The custom taxonomy metabox inside the admin/post.php does show up but it will not show the custom taxonomies attached to that post.
That is because $post objects ID (meaning $post->ID) is equal to true instead to the post id (an integer).
var_dumping (starts at line 269) the post object inside function post_tags_meta_box($post, $box) (wp-admin/includes/meta-boxes.php)
Will show up something like the following.

object(stdClass�K�c���)[267]
  public 'ID' => boolean true
  public 'post_author' => string '1' (length=1)
  public 'post_date' => string '2012-12-05 14:00:06' (length=19)
  public 'post_date_gmt' => string '2012-12-05 14:00:06' (length=19)
  public 'post_content' => string 'Bla bla' (length=7)
  public 'post_title' => string 'The best sale in the world' (length=26)

etc ..

The method being called from the wp-files/edit-form-advanced.php file from line 118 or 120 (depending wether it is hierarchical or not).
var_dumping the $post object inside before the foreach loop (line 110) will show up the good post data (ID set to an integer)

Change History (6)

comment:1 helenyhou6 months ago

I can't reproduce any of the above, and line 269 in wp-admin/includes/meta-boxes.php is not within the post_tags_meta_box() function in trunk.

comment:2 nacin6 months ago

  • Keywords reporter-feedback added

This sounds like an issue with a plugin.

That could potentially be serious and related to WP_Post. (This post object should be a WP_Post object, for sure.)

Can you please:

  • Update to latest trunk.
  • Determine if this is a plugin by deactivating them.
  • Identify the plugin.

comment:3 nacin6 months ago

  • Description modified (diff)

comment:4 guymaliar6 months ago

I couldn't reproduce it on a vanilla trunk copy.
It was in a plugin I created (custom post type and custom taxonomies were used).
It fixed somewhat miraculously by fixing an error notice on another page down the plugin workflow.

comment:5 guymaliar6 months ago

  • Resolution set to invalid
  • Status changed from new to closed

comment:6 helenyhou6 months ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.