Created
May 24, 2024 08:22
-
-
Save KaineLabs/ccb1362a92270abfd81955fe5f3f28eb to your computer and use it in GitHub Desktop.
Youzify - Make non admins Pin/Unpin Posts.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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