[wp-trac] [WordPress Trac] #18624: wpmu_update_blogs_date() should not be called on private_to_published
WordPress Trac
wp-trac at lists.automattic.com
Fri Sep 9 19:28:52 UTC 2011
#18624: wpmu_update_blogs_date() should not be called on private_to_published
--------------------------+-----------------------
Reporter: mdawaffe | Owner: nacin
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 3.3
Component: Multisite | Version: 3.2.1
Severity: normal | Resolution:
Keywords: has-patch |
--------------------------+-----------------------
Changes (by nacin):
* status: closed => reopened
* resolution: fixed =>
Comment:
> So, technically, this change may break things. It's possible
wpmu_update_blogs_date should be called when publishing custom post types.
Maybe, maybe not. The current functionality applies only to posts. I
imagine that was the intention, and generally that's what a last updated
date would signify. The only exception is that it also applies to any
other post type but only when it goes from private to publish. (Well, I'm
wrong about that -- more in a moment.) That is a side effect from how that
hook has evolved over time.
Interesting, I thought that private_to_published was solely a private to
publish hook, but I misread the code. Unfortunately there's no
corresponding hook for that kind of change.
I'd probably support a `post_changed_to_{$new_status}` hook, or something
to that effect, that way we could do `post_changed_to_publish`. Currently
you'd have to hook into transition_post_status and do checks on new_status
and old_status. It's actually the most common use case I've used one of
those three hooks for.
Sidenote: I like how I was able to say "all posts" versus "[only] posts"
and you understood I meant post types. Man, that's confusing. :-)
Re-opening, since this does break compat, as it *has* been applied to all
post types until now.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18624#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list