Forum Replies Created
-
Haven’t used it in a while but try
bp_is_current_item(). So, your condition would be:if ( bp_is_groups_component() && bp_is_current_item( 'events' ) ) { // Code. }Try
bp_is_groups_component().Ref: https://codex.buddypress.org/developer/template-tag-reference/
In reply to: how can i change word Forums?@bruce30 I’ve made an edit to the code above which means it’ll now work for all text on your site, not just bbPress or BuddyPress text. So now if a new third-party plugin you add decides to use the word Forum, that will also be translated. I think this is a better approach.
In reply to: how can i change word Forums?@bruce30, building on @danbp’s answer, you can add another
case. Take a look at this example below which has 4 cases. Feel free to add or remove cases yourself. The number of cases you use will depend on the number of words or phrases you need to change.function bruce_localisation( $translated, $original_text, $domain ) { switch ( $original_text ) { // 1 case 'Forums': return 'Discussions'; // 2 case 'Forum': return 'Discussion'; // 3 case 'Piano': return 'Guitar'; // 4 case 'Lion': return 'Tiger'; default: return $translated; } } add_filter( 'gettext', 'bruce_localisation', 10, 3 );In reply to: how can i change word Forums?I think the language file is your best bet. Have you tried that?
In reply to: how can i change word Forums?A slug is what you see in the URL. So for example:
example.com/this-is-a-slug/
In reply to: how can i change word Forums?I think so with the use of a language file.
Ref: https://codex.buddypress.org/getting-started/customizing/customizing-labels-messages-and-urls/
Also, according to the Customizable Slugs in BuddyPress article, you should be able to add this to your wp-config.php file to change your slug:
define ( 'BP_FORUMS_SLUG', 'discussions' );Ref: https://buddypress.org/2009/05/customizable-slugs-in-buddypress/
In reply to: how can i change word Forums?Do you mean change the wording of the navigation tab that reads Forums?
In reply to: Redirect After “Join Group” ContinuedThe code you’ve posted gets the current group and first compares that group’s slug to social-group-547668396. If a match occurs, the default tab is set to calendar. If no match occurs then the group’s slug is compared to husbands-out. If a match occurs, the default tab is set to forum. If the group’s slug doesn’t match any of those, the default tab is set to home.
I don’t think any of this will happen at the point a join group button is clicked.
My thinking is you will need to hook to an action such as
groups_join_group(which will fire immediately after a user joins a group) and then perform a direct to the forum tab (or to the default tab if that is set to forum).I think something like this:
function my_redirect_after_join_group( $group_id, $user_id ) { $group = groups_get_group( array( 'group_id' => $group_id ) ); bp_core_redirect( bp_get_groups_directory_permalink() . $group->slug . '/forum/' ); } add_action( 'groups_join_group', 'my_redirect_after_join_group', 10, 2 );Please note I haven’t tested.
In reply to: how can i change word Forums?In reply to: compatibility issue with oauth plugindo you mean remove something into de plugin code?
No.
remove_action()is a function that lets you remove an action hook. Try reading up on WordPress actions; they’re a way to modify behaviour without editing core files.In reply to: Adding user id to members directoryYour code looks good. Which file are you putting it in?
Edit: 2nd thoughts, you may need to rename the function. Try giving it a prefix. For example:
function my_bp_displayed_user_id() { $theUserID = bp_get_member_user_id(); echo "MemberID: " . $theUserID; } add_action( 'bp_directory_members_item', 'my_bp_displayed_user_id' );In reply to: Redirect After “Join Group” ContinuedRegarding your original question:
Is there a way to redirect to forum from “Join Group” button please.
The code you’ve posted here won’t perform a redirect; instead, it filters the default groups tab. I would imagine you’d also need a redirect put in place (which might explain why you see no change when you add the code snippet).
In reply to: Extended Profile Not WorkingIf you use the TwentyFifteen theme and disable all plugins, do you still get the error?
In reply to: compatibility issue with oauth pluginTry finding the BuddyPress redirect and check if it’s removable.
remove_action()might be handy in this situation, depending on how the redirect is coded.Ref: https://codex.wordpress.org/Function_Reference/remove_action
In reply to: Remove or hide “@” on profile in front of usernameCheck the @ isn’t being added by your theme. If it is, then you can use the Template Hierarchy to override the relevant templates.
In reply to: Error – BP_MESSAGES_AUTOCOMPLETE_ALLCould be theme-related or perhaps a plugin is conflicting. Try with TwentyFifteen and all plugins disabled.
In reply to: Downgrade to 2.3.3You’ll need to roll back your:
- files and folders (just delete the BuddyPress plugin and install version 2.3.3)
- database (do you keep backups?)
Note: You’ll need to do both. That said, your current database may still work if no changes have been made to the schema since 2.3.3. But proceed with caution and before you start anything back up everything!
Avoid editing core files and you should be fine. Instead, put your functions and code snippets in a bp-custom.php file or your child theme’s functions.php.
Also, check out the Template Hierarchy article for info on template editing.
In reply to: Redirect After “Join Group” ContinuedThe idea here would be to hook in to an action that fires after the join group event. Check out
add_action()which should help you do that. You’d usebp_core_redirect()inside your custom function.Hoping this helps?
Ref https://codex.wordpress.org/Function_Reference/add_action
In reply to: Site FeedbackGreat effort @britbox, I really like the look and feel of the site.
In reply to: Registration pageIf you’re experiencing some kind of redirect, then that’s likely coming from either a plugin, or your active theme.
In reply to: ‘Save Button’ missing from page tab in settingsCan you provide a screenshot to show us what you’re seeing?
In reply to: Disable public messageWhere do I find bp-custom.php? I searched the bp folders but couldn’t find the file.
You won’t have a bp-custom.php file by default so you will need to create one inside the plugins folder. So for example:
wp-content/plugins/bp-custom.php
The contents of the file should be:
<?php // Put your code snippets hereIn reply to: Customize email templates