[wp-trac] [WordPress Trac] #28172: edit_post() should call {un}stick_post() before calling wp_update_post()

WordPress Trac noreply at wordpress.org
Thu May 8 21:42:43 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 Denis-de-Bernardy):

 Replying to [comment:5 pbiron]:
 > BTW, one of the checks my `save_post` action is doing is making sure
 that there is only 1 sticky post in any given category (to avoid some of
 the problems mentioned in #23336, where users "forget" to unstick posts).
 >
 > And what you said above gave me an idea for a possibly better "fix" (…)

 Or, you could simply hook into `pre_update_option_sticky_posts` and run a
 sanity check on the array that is about to get stored, and return a
 trimmed version of the array.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28172#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list