[wp-trac] [WordPress Trac] #17548: wp_trash_post() does not call update_post_count()

WordPress Trac wp-trac at lists.automattic.com
Mon Oct 10 19:34:56 UTC 2011


#17548: wp_trash_post() does not call update_post_count()
--------------------------------------------------+-----------------------
 Reporter:  joehoyle                              |       Owner:  ryan
     Type:  defect (bug)                          |      Status:  reopened
 Priority:  normal                                |   Milestone:  3.3
Component:  Taxonomy                              |     Version:  3.2
 Severity:  normal                                |  Resolution:
 Keywords:  has-patch dev-feedback needs-testing  |
--------------------------------------------------+-----------------------

Comment (by joehoyle):

 > The problem is that the object types are array( 'attachment:image',
 'attachment:video', 'attachment:audio' ), This throws off the in_array()
 check and the post_type IN part of the query. I guess we need to trim :*
 off the end of the types.

 The object types are not even registered on a taxonomy that is assigned
 terms with matt's plugin.  array( 'attachment:image', 'attachment:video',
 'attachment:audio' ) is registered for the People taxonomy, but it appears
 Matt's plugin does not even assign terms to that taxonomy (yet at least).

 If it were adding `attachment:image` etc to post_tag / category then the
 patch would not work, however from what I see `attachment:image` is not
 even a valid post type. `register_taxonomy_for_object_type( 'post_tag',
 'attachment:image' );` returns false, because it does not recognise it as
 a registered post type, so why are we trying to fix this issue? It seems
 to me Matt's plugin is currently very rough round the edges and we are
 trying to patch odd cases (such as "attachment:image") that are not even
 registered for the taxonomy we are testing against.


 >Do we even need to query against post_type?

 Probably not, but I thought it would be better to be more specific and
 only run against registered post types for that taxonomy. Again, why are
 we trying to fix "attachment:image", unless I have missed something,
 "attachment:image" is not a default registered post type / anything
 special? There is no spec for ":image, :audio" etc on post types, It's
 just something matt wrote.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17548#comment:33>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list