Created
December 21, 2023 09:25
-
-
Save goranefbl/45542a885531771162364a783f2ade9b to your computer and use it in GitHub Desktop.
show only to admins
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
add_filter('wpgens_raf_code','gens_raf_code',10,1); | |
function gens_raf_code($raf_code) { | |
if( !current_user_can('manage_options')) { | |
return 'Referral code is available only to Editors'; | |
} | |
return $raf_code; | |
} | |
add_filter('wpgens_raf_link','gens_raf_link',10,3); | |
function gens_raf_link($raf_link, $referral_id, $type) { | |
if( !current_user_can('manage_options')) { | |
return 'Referral link is available only to Editors'; | |
} | |
return $raf_link; | |
} | |
add_action('wp','wpgens_custom_account_tabs'); | |
function wpgens_custom_account_tabs(){ | |
if( !current_user_can('manage_options')) { | |
$gens_plugin = WPGens_RAF::instance(); | |
remove_filter( 'woocommerce_account_menu_items', array($gens_plugin->my_account,'gens_account_menu_item'),10); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment