-
Henry Wright replied to the topic How to make section of profile private? in the forum How-to & Troubleshooting 9 years, 7 months ago
I experimented with the code but couldn’t get it to work
Looking into it now…
—
As an aside, whilst looking through the plugin’s code, I noticed that endpoints (example.com/author/username/achievements) are used if you ever have BuddyPress disabled. Just something to keep in mind.
-
Henry Wright replied to the topic How to make section of profile private? in the forum How-to & Troubleshooting 9 years, 7 months ago
Hi @screampuff
You can make that link private by doing something like this:
function screampuff_hide_achi() {
// Bail if the current user is the displayed user.
if ( bp_loggedin_user_id() == bp_displayed_user_id() )
return;// Bail if the current user is an admin.
if ( current_user_can( 'manage_options' ) )…[Read more] -
Henry Wright replied to the topic How to make section of profile private? in the forum How-to & Troubleshooting 9 years, 7 months ago
Hi @screampuff
You can make that link private by doing something like this:
function screampuff_hide_achi() {
// Bail if the current user is the displayed user.
if ( bp_loggedin_user_id() == bp_displayed_user_id() )
return;// Bail if the current user is an admin.
if ( current_user_can( 'manage_options' ) )…[Read more] -
Henry Wright replied to the topic How to make section of profile private? in the forum How-to & Troubleshooting 9 years, 7 months ago
Hi @screampuff
You can make that link private by doing something like this:
function screampuff_hide_achi() {
// Bail if the current user is the displayed user.
if ( bp_loggedin_user_id() == bp_displayed_user_id() )
return;// Bail if the current user is an admin.
if ( current_user_can( 'manage_options' ) )…[Read more] -
Henry Wright replied to the topic How to hide section of profile to all but that user and admin? in the forum How-to & Troubleshooting 9 years, 7 months ago
Hi @screampuff
You could try the following function which will stop unwanted users from viewing the page directly if they tried typing the URL:
function my_hide_achievements_page() {
$role = xprofile_get_field_data( 'Membership' );if ( ( $role != 'Administrator' ) || ( bp_current_user_id() == bp_displayed_user_id() ) )…[Read more]
-
Henry Wright replied to the topic How to hide section of profile to all but that user and admin? in the forum How-to & Troubleshooting 9 years, 7 months ago
Hi @screampuff
You could try the following function which will stop unwanted users from viewing the page directly if they tried typing the URL:
function my_hide_achievements_page() {
$role = xprofile_get_field_data( 'Membership' );if ( ( $role != 'Administrator' ) || ( bp_current_user_id() != bp_displayed_user_id() ) )…[Read more]
-
Henry Wright replied to the topic How to hide section of profile to all but that user and admin? in the forum How-to & Troubleshooting 9 years, 7 months ago
Hi @screampuff
You could try the following function which will stop unwanted users from viewing the page directly if they tried typing the URL:
function my_hide_achievements_page() {
$role = xprofile_get_field_data( 'Membership' );if ( ( $role != 'Administrator' ) || ( bp_current_user_id() == bp_displayed_user_id() ) )…[Read more]
-
Henry Wright replied to the topic How to hide section of profile to all but that user and admin? in the forum How-to & Troubleshooting 9 years, 7 months ago
Hi @screampuff
You could try the following function which will stop unwanted users from viewing the page directly:
function my_hide_achievements_page() {
$role = xprofile_get_field_data( 'Membership' );if ( ( $role != 'Administrator' ) || ( bp_current_user_id() == bp_displayed_user_id() ) )
return;// I guess we should 404…[Read more]
-
Henry Wright replied to the topic How to hide section of profile to all but that user and admin? in the forum How-to & Troubleshooting 9 years, 7 months ago
Hi @screampuff
You could try the following function which will stop unwanted users from viewing the page directly:
function my_hide_achievements_page() {
$role = xprofile_get_field_data( 'Membership' );
if ( ( $role != 'Administrator' ) || ( bp_current_user_id() == bp_displayed_user_id() ) )
return;// I guess we should 404…[Read more]
@screampuff
Active 8 years, 6 months ago