Resources

My Agape try

Your Agape try


Support Forum

You must be logged in to post Login Register

Search 
Search Forums:


 




Sticky Overrides Restrictions?

UserPost

10:32 am
February 19, 2010


baslack

Member

Kalamazoo, MI US

posts 2

1

I'm trying out Role Scoper and I've stumbled on something that seems wrong. I wanted to post an announcement for the admistrators of my site, so I went through and restricted the message and set it to sticky. Unfortunately, sticky seems to override your restriction, putting the post to the front of the loop regardless. Is there a way to address this?

12:33 pm
February 19, 2010


Kevin

Admin

posts 2503

2

baslack said:

Unfortunately, sticky seems to override your restriction, putting the post to the front of the loop regardless.


Good call; I'm surprised this hasn't come up before. Adding the following to plugins/role-scoper/query-interceptor-front_rs.php should take care of it:

function scoper_sticky_posts( $post_ids ) {
	if ( $post_ids && ! is_content_administrator_rs() ) {
		global $wpdb;
		$post_ids = scoper_get_col( apply_filters( 'objects_request_rs', "SELECT ID FROM $wpdb->posts WHERE ID IN ('" . implode( ',', $post_ids ) . "')", 'post' ) );
	}

	return $post_ids;
}
add_filter( 'option_sticky_posts', 'scoper_sticky_posts' );

3:04 pm
February 19, 2010


baslack

Member

Kalamazoo, MI US

posts 2

3

That appears to have done the trick. Thank you very much.


About the Agapetry forum

Currently Online:

15 Guests

Maximum Online: 150

Forums:

Groups: 2

Forums: 7

Topics: 1249

Posts: 5659

Members:

There are 1261 members

There are 1 guests


Kevin has made 2503 posts

Top Posters:

metal450 - 178

Ragnar - 108

YikYak - 70

whiteorb - 49

Daisy - 35

Administrator: Kevin | Moderators: Kevin