Forum Replies Created
-
In reply to: Show Follow Button on Each Member’s Profile Page
Hi @ottiya-
Right. With that plugin, I don’t think you should have to do anything. It hooks into the
'bp_member_header_actions'to generate the follow button in place of the friend button, so the default member header should work fine. I’d try having no overwrite template in place.If you’re still not seeing the “follow” button, deactivate the follow plugin and see if the “add friend” button is appearing as expected.
In reply to: Question Regarding Group Creation LinkThanks for opening the Trac ticket.
In reply to: PHP 7.0 en 7.1 update needed, site is slowrtMedia is a plugin of its own and not a part of a standard WordPres install. Check out their support forum here:
In reply to: Change activity link on a multi language siteHi Martijn-
I imagine that the reason that no one answered is that none of the volunteers that offer help here knows anything about your specific issue.
You can change the activity directory link like you were guessing, using the
bp_get_activity_directory_permalinkfilter:add_filter( 'bp_get_activity_directory_permalink', function ( $url ) { $language = Weglot::Instance()->getCurrentLang(); if ( $language != 'en') { $url = $url . '/' . $language; } return $url; });Note that BuddyPress uses the url (and the positions of elements in it, like
/members/username/action/subaction) to calculate a number of things, so we can’t say whether the weglot approach will work well with BP.Best of luck.
In reply to: [Resolved] Change Order by (Groups –> Documents)Hi Ulrich-
I’m guessing this is also about BP Docs, and the same filter holds the answer:
add_filter( 'bp_after_bp_docs_has_docs_parse_args', function ( $args ) { $args['orderby'] = 'title'; $args['order'] = 'ASC'; return $args; } );In reply to: [Resolved] Change number of Viewing item (Groups)Hi Ulrich-
It sounds like you’re talking about BuddyPress Docs, not BP. If so, there’s a filter, and you could use it something like this:
add_filter( 'bp_after_bp_docs_has_docs_parse_args', function ( $args ) { $args['posts_per_page'] = 100; return $args; } );In reply to: Profile Links – Removing http/httpsSounds promising!
In reply to: Register issues – LoopingHello there. BuddyPress doesn’t use a shortcode–a register page just need to exist and be identified. Could you be using some other plugin?
Otherwise, double-check that the register page is properly associated at wp-admin > settings > buddypress.
Hello, if emails are being sent (you’re receiving them at a Yahoo address), then my first guess would be that gmail is treating the mails as spam. Look in your spam folder to see if they’re there.
There are a number of ways to improve deliverability, but that’s beyond the scope of BuddyPress. You might read up on the topic at SparkPost or one of the other bulk email providers.
In reply to: Fixing deprecated bp_nav code?To change items, see the link I referenced: https://codex.buddypress.org/developer/navigation-api/#change-item-names-of-users-and-groups-nav-menus
In reply to: Show Follow Button on Each Member’s Profile PageBuddyPress adds the friends button via the action:
add_action( 'bp_member_header_actions', 'bp_add_friend_button', 5 );You’re saying “follow” so I’m assuming that you’re using a plugin that modifies the basic BP behavior. You might check to see that that plugin doesn’t unhook the
bp_add_friend_button()from the member header. Otherwise, the friendship button appears in the member header in BP’s default themes.In reply to: Profile Links – Removing http/httpsHuh. Well, I guess you could probably find URLs like that using some regular expression pattern for
<a href="<url>"><url></a>and apply it like you did at https://core.trac.wordpress.org/ticket/32787, but I’m no regex expert, so I can’t help with that.
It would be easier once
make_clickable()adds a filter, for sure.In reply to: Email’s situation’s are not displayed…You can also try the BuddyPress email reinstallation tool if you’re having problems. It’s in WP Admin at Tools > BuddyPress, like
/wp-admin/tools.php?page=bp-tools.In reply to: Question Regarding Group Creation LinkHi @destac-
Please open a ticket on trac: https://buddypress.trac.wordpress.org/
which is a better place to suggest improvements to BuddyPress.
Thanks!
-David
I’m note sure how your custom roles were created, so I can’t tell you how to figure out if the current user is one or the other, but basically, you’ll be using code like this:
function bpcodex_remove_member_tab_on_role() { $role = 'owner; if ( 'owner' == $role ) { bp_core_remove_nav_item( 'messages' ); bp_core_remove_nav_item( 'friends' ); } } add_action( 'bp_actions', 'bpcodex_remove_member_tab_on_role' );note that this will not work as is–you need to be able to get the current user’s role, dependent on how you’re doing that. However, the simpler answer is that if you’re not using the friends and messages components, just turn them off in the BuddyPress settings in wp-admin.
In reply to: creating a group type pageHi, those details are parsed in
bp_ajax_querystring(), and there’s a filter you can work with:bp_ajax_querystring.You can also filter the query args for every
bp_has_groups()loop directly, using the filterbp_after_has_groups_parse_args.However, the simpler answer is probably to use your group type’s built-in directory page, which would have a URL like
groups/types/ukand then the AJAX stuff is already aware that your view is limited to a single type.In reply to: Fixing deprecated bp_nav code?Hi @katmacau-
Here are some examples for changing navigation menus using the new API:
This is what I’m guessing you’ll want to use:
function bpcodex_remove_member_notifications_tab() { bp_core_remove_nav_item( 'notifications' ); } add_action( 'bp_actions', 'bpcodex_remove_member_notifications_tab' );One question though: if you’re not using the notifications, why not just turn off the notifications component in the BuddyPress settings screen in wp-admin?
In reply to: Profile Links – Removing http/httpsHi there. If I’m understanding correctly, you’re wanting to modify URLs added to profile fields by your users. The profile fields are analyzed for search links and other links here:
https://buddypress.trac.wordpress.org/browser/tags/2.9.3/src/bp-xprofile/bp-xprofile-filters.php#L326BP uses the WP function
make_clickable()to make links clickable. It doesn’t look like that function is filterable at the moment (there’s a ticket: https://core.trac.wordpress.org/ticket/32787). I guess you could do something using the filter offered on the forum link you reference, but I’m not sure how you’d know which kind of links to modify (it’s not clear from your question what the goal is).I’ve written a updated plugin to add group hierarchy: https://github.com/dcavins/hierarchical-groups-for-bp
It’s basically a drop-in replacement for the original BPGH, with a few other features rolled in. Be sure to use the plugin’s options page to import your BPGH group settings.
In reply to: Admin and other usergourp color in online widgetHere’s an example of how to add the user’s roles to their avatar (profile image).
https://gist.github.com/dcavins/31c2f264d0e56cd2832cb3c63a994b97Then you can use css to change the appearance based on roles.
In reply to: creating group type pagesHi, the groups directory can handle that using some built-in arguments: https://codex.buddypress.org/developer/group-types/
mysite.com/groups/type/ninja could be use to show only groups of type “ninja”.
In reply to: How to create a dynamic link to “my friends”@commando1 As long as you have BP 2.6 or newer, the redirection will happen automatically. If it isn’t, you might try turning off other plugins to see if any of them have hijacked some URLs.
In reply to: Creating custom registration page, moving elementsHi there,
Here’s an example of adding a custom section to the registration form. All you have to do if it’s static is add it and handle the input:
https://gist.github.com/dcavins/e3e6a702e35d4f9ec8948c920d8b6c03You could similarly add other profile fields/field groups on any of the hooks available on the registration page, though I’d use a profile field group loop to output those items.
In reply to: Broken linksThe links themselves look OK to me (BuddyPress is generating the correct links), but they are redirecting away at the server level. I’d check your htaccess files and other server-level routing code to find where the malicious code’s been added.
Also, change your hosting setup passwords (like control panel, FTP access, DB access) as soon as you can.
Place the template file you want to use in your child them at the location specified here: https://codex.buddypress.org/themes/theme-compatibility-1-7/template-hierarchy/#registration-page
When BuddyPress is updated, it won’t affect your child theme.