Skip to content

Instantly share code, notes, and snippets.

@wbcomdev
Last active September 15, 2023 05:30
Show Gist options
  • Select an option

  • Save wbcomdev/0b57abdc9fa094681d2ffb48f3cc60d8 to your computer and use it in GitHub Desktop.

Select an option

Save wbcomdev/0b57abdc9fa094681d2ffb48f3cc60d8 to your computer and use it in GitHub Desktop.
Allows the user roles to stick the posts
<?php
**
* Wbcom Designs - Add user roles for sticky post
*
* @param array $user_roles user role.
* @return array
*/
function wbcom_add_roles_for_sticky_post( $user_roles ) {
$add_user_roles = array( 'subscriber' );
$user_roles = array_merge( $add_user_roles, $user_roles );
return $user_roles;
}
add_filter( 'bpsp_allow_user_roles', 'wbcom_add_roles_for_sticky_post', 10, 1 );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment