Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fake_sticky_posts_for_author() {
- $user = wp_get_current_user();
- if ( get_current_user_id() && in_array('author', $user->roles) ) {
- return get_posts( array(
- 'author' => get_current_user_id(),
- 'fields' => 'ids',
- 'posts_per_page' => -1
- ) );
- }
- return false;
- }
- add_filter( 'pre_option_sticky_posts', 'fake_sticky_posts_for_author' );
- // we use pre_option_sticky_posts in here, since we want to ignore value of this option, so there is no point to load it
Add Comment
Please, Sign In to add comment