Skip to content

Instantly share code, notes, and snippets.

@KaineLabs
Created May 24, 2024 08:22
Show Gist options
  • Save KaineLabs/ccb1362a92270abfd81955fe5f3f28eb to your computer and use it in GitHub Desktop.
Save KaineLabs/ccb1362a92270abfd81955fe5f3f28eb to your computer and use it in GitHub Desktop.
Youzify - Make non admins Pin/Unpin Posts.
<?php
// Make non admin able to pin/unpin posts
function _yz_show_pin_tool(){
$pin = ['administrator'];
if( !current_user_can('administrator') ){
$pin = ['administrator', 'shop_manager'];
}
return $pin;
}
add_filter('youzify_allowed_roles_to_pin_posts', '_yz_show_pin_tool', 10 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment