[wp-trac] [WordPress Trac] #28172: edit_post() should call {un}stick_post() before calling wp_update_post()
WordPress Trac
noreply at wordpress.org
Fri May 9 00:01:51 UTC 2014
#28172: edit_post() should call {un}stick_post() before calling wp_update_post()
-------------------------------+------------------------------
Reporter: pbiron | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version: trunk
Severity: normal | Resolution:
Keywords: | Focuses:
-------------------------------+------------------------------
Comment (by pbiron):
Replying to [comment:8 nacin]:
> As a general rule, we should be doing things before the wp_update_post()
call, not after. This includes setting a post format or whatever else.
I just did a quick check and it may not always be always be possible to do
things '''before''' `wp_{insert,update}_post()`. The first case I found
is `get_default_post_to_edit()`: which calls `wp_insert_post()` and
'''then''' `set_post_format()` when the $create_in_db parameter == true;
and the way `set_post_format()` is written it requires the post to exist
in the db before it is called :-(
What do you think of my [comment:5 idea] of handling those things in
functions hooked in core to `save_post`?
I'll volunteer to do a first pass on a list of all the places where
`wp_{insert,update}_post()` is called where any info is written to the db
after that call. However, I probably won't be able to do that for a few
weeks: the plugin I'm writing that made me open this ticket is for a
client site that has a '''hard''' go-live date in just a few weeks and I
have to get that site launched before spending much time on this (of
course, I'll have to find some workaround for my problem for that go-live,
because I know that this issue won't be resolved and released before
then).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28172#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list