[wp-trac] [WordPress Trac] #35600: Hooks for post sticky status changes

WordPress Trac noreply at wordpress.org
Mon Jan 25 12:03:41 UTC 2016


#35600: Hooks for post sticky status changes
-------------------------------+-----------------------------
 Reporter:  ojrask             |      Owner:
     Type:  enhancement        |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Posts, Post Types  |    Version:  4.4.1
 Severity:  normal             |   Keywords:
  Focuses:                     |
-------------------------------+-----------------------------
 Currently sticky post status changes are hookable using the
 `update_option` hook variants which are fired when `stick_post` and
 `unstick_post` functions are called.

 Getting the sticked post in those hooks is a little bit annoying, as you
 have to parse old and new values for an updated option.

 I'd suggest adding action hooks to `stick_post` and `unstick_post` to fire
 some action called such as

 {{{#!php
 <?php

 do_action('post_sticked', $post->ID);
 do_action('post_unsticked', $post->ID);
 }}}


 I could not find any straightforward hook that allows hooking as described
 above.

 Let me know if there is a feature like the one above which I could not
 find, and whether the suggested enhancement would be good or bad, or in
 need of more discussion.

 One thing I would like to know whether this would have broader benefits or
 whether this would be considered a small goal for a very small portion of
 developers.

 Marked the version as latest stable, but I presume the feature is not
 available in any version which has included sticky posts.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35600>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list