Skip to content

Instantly share code, notes, and snippets.

@jamalkhan2k6
Last active October 31, 2018 11:41
Show Gist options
  • Save jamalkhan2k6/27ffa05ae7d2e86fe178d236851a240d to your computer and use it in GitHub Desktop.
Save jamalkhan2k6/27ffa05ae7d2e86fe178d236851a240d to your computer and use it in GitHub Desktop.
// Find this in filemanager.php (probably line 363)
function fm_access_shortcode( $atts, $content = null ){
extract(shortcode_atts(array(
'group' => '',
), $atts));
$red_current_user = wp_get_current_user();
$red_current_id = $red_current_user->ID;
$red_fm_role = reset($red_current_user->roles);
update_option("red_fm_debug", print_r($red_fm_role, true));
if($red_fm_role == $group){
echo do_shortcode($content);
}elseif($group == "logged-in" && is_user_logged_in()){
echo do_shortcode($content);
}elseif($group == "not-logged-in" && !is_user_logged_in()){
echo do_shortcode($content);
}else{
return "";
}
}
add_shortcode( 'fm_access', 'fm_access_shortcode' );
@jamalkhan2k6
Copy link
Author

Find this in filemanager.php (probably line 363)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment