Last active
October 31, 2018 11:41
-
-
Save jamalkhan2k6/27ffa05ae7d2e86fe178d236851a240d to your computer and use it in GitHub Desktop.
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
// 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' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Find this in filemanager.php (probably line 363)