-
Henry replied to the topic Private Portal with BuddyPress in the forum Creating & Extending 11 years, 3 months ago
Hi @mossyoak
I’ve run a few tests and made some slight changes to that code. Try this
function bp_my_restrict() {
$user_id = bp_loggedin_user_id();
$user = new WP_User( $user_id );if ( ( $user->roles[0] != 'administrator' ) ) {
if ( bp_is_current_component('members') || bp_is_current_component('activity') ) {…[Read more]
-
Henry replied to the topic How can I create a different page for Activity Streams? in the forum Creating & Extending 11 years, 3 months ago
These components already have their own pages.
As examples, try visiting:
yourwebsite.com/activity
yourwebsite.com/members -
Henry replied to the topic Private Portal with BuddyPress in the forum Creating & Extending 11 years, 3 months ago
Just read through your original question. The code snippet you’d want to add to your theme’s functions.php is something like this:
function bp_my_restrict() {
global $bp;
$user_id = bp_loggedin_user_id();
$user = new WP_User( $user_id );if ( bp_is_current_component('members') || bp_is_current_component('activity') ) {…[Read more]
-
Henry replied to the topic Private Portal with BuddyPress in the forum Creating & Extending 11 years, 3 months ago
Try this
<?php
$user_id = bp_loggedin_user_id();
$user = new WP_User( $user_id );if ( $user->roles[0] != 'administrator' ) {
// your code
}?>
-
Henry replied to the topic Private Portal with BuddyPress in the forum Creating & Extending 11 years, 3 months ago
You could use the WordPress conditional
is_page()
to check if the user is on the activity or members page:
if ( is_page('members') || is_page('activity') ) {
} else {
}
Note: I’m assuming you haven’t changed the default slugs
-
Henry replied to the topic Show members with certain role in the forum Creating & Extending 11 years, 3 months ago
It is easily done. You’d need to create a new page template:
https://codex.wordpress.org/Page_Templates
You can then use a modified members loop inside the page template you create:
-
Henry replied to the topic Show members with certain role in the forum Creating & Extending 11 years, 3 months ago
<?php
$user_id = bp_get_member_user_id();
$user = new WP_User( $user_id );if ( $user->roles[0] != 'editor' )
break;
?>That’ll display only editors
-
Henry replied to the topic Show members with certain role in the forum Creating & Extending 11 years, 3 months ago
<?php
$user_id = bp_get_member_user_id();
$user = new WP_User( $user_id );if ( $user->roles[0] == 'editor' )
break;
?>If you add that code directly below
while ( bp_members() ) : bp_the_member();
you’ll get a list of members who are not editors. -
Henry replied to the topic Registration Process in the forum How-to & Troubleshooting 11 years, 3 months ago
Not currently for hire due to a lack of time – that said, there are quite a few BP developers who will be able to help. Perhaps check who is available on the jobs board. @shanebp might be a good person to ask
-
Henry replied to the topic Registration Process in the forum How-to & Troubleshooting 11 years, 3 months ago
Your theme’s functions.php file wouldn’t get overwritten with each update. The changes you make to this file will be safe going forward.
A great place to hire a BuddyPress developer would be the BP Jobs Board:
-
Henry replied to the topic Show members with certain role in the forum Creating & Extending 11 years, 3 months ago
If you use this code directly below
while ( bp_members() ) : bp_the_member();
in the members loop, you’ll be able to see which members are editors.
<?php
$user_id = bp_get_member_user_id();
$user = new WP_User( $user_id );if ( $user->roles[0] == 'editor' ) {
echo 'this user is an editor';
} else {
echo 'this user is…[Read more] -
Henry replied to the topic Registration Process in the forum How-to & Troubleshooting 11 years, 3 months ago
You’re on the right track – although it isn’t your theme’s style.css that you’d want to add it to. You’d add it to your theme’s functions.php file.
-
Henry replied to the topic Registration Process in the forum How-to & Troubleshooting 11 years, 3 months ago
The activation email body can be filtered using
bp_core_signup_send_validation_email_message
The subject line can also be changed
bp_core_signup_send_validation_email_subject
For example: To change the subject line you would add this to functions.php
[Read more]
function activation_email_subject_filter( $subject, $user_id ) {
$subject = 'Hello New… -
Henry replied to the topic How to make Avatar a requirement? in the forum How-to & Troubleshooting 11 years, 3 months ago
Which premium plugin did you find?
To make uploading an avatar a requirement you’d have to have an upload form on the registration page. This used to happen in BuddyPress. Some discussion on it in this thread:
https://wordpress.org/support/topic/plugin-buddypress-avatar-upload-in-registration-form -
Henry replied to the topic Eliminating WordPress Usernames from displaying in BP in the forum Installing BuddyPress 11 years, 3 months ago
Disabling usernames sitewide sounds like a huge task to me. BuddyPress needs a unique identifier to use in URLs. Have you thought about providing your members with the ability to change their username?
You’d just need to send a global message to all members letting them know how they can update…[Read more]
-
Henry replied to the topic Media Plugin for Buddypress in the forum Third Party Plugins 11 years, 3 months ago
There was an alternative to BuddyPress Media (rtMedia) – I think it was called BP Media. I’m not sure if it is supported anymore or even in the WP plugin repository but it might be worth a try if you can get hold of it. That said, rtMedia is working very well for me on my test site. Will be putting it live in the next few weeks.
-
Henry replied to the topic Remove [Site Name] from email subject line in the forum How-to & Troubleshooting 11 years, 3 months ago
Hi @naijaping I tried that filter and it doesn’t work. Does it still work for you?
-
Henry started the topic Remove [Site Name] from email subject line in the forum How-to & Troubleshooting 11 years, 3 months ago
Does anyone know if the [Site name] part of BuddyPress core email subject lines is filterable? The subject line always seems to start with the site name in square brackets. The site name already appears in the ‘from’ field so I don’t feel it’s needed in the subject line as well.
-
Henry replied to the topic Hide/restrict access to Private Messaging in the forum Creating & Extending 11 years, 3 months ago
@shanebp – oops thanks for pointing that out.
global $bp;
can be removed -
Henry replied to the topic Private Message Button Label Change in the forum How-to & Troubleshooting 11 years, 3 months ago
@shanebp good point about using the bp_send_private_message_link approach. Although you would avoid double buttons by using a translation file.
- Load More
@henrywright-1
Active 9 years, 10 months ago