Forum Replies Created
-
In reply to: BP-12. – BP Classic
@giszech Delete old BuddyPress pages with “under construction” subtitle to avoid conflicts with the new setup after activating BP Classic. You can deactivate BP Classic after that.
in BP v12, these pages are not required anymore.In reply to: How to disable the member (directory) page?@jchretien
Replace ‘your_member_type’ with the actual slug of your desired member type.function wbcom_custom_bp_members_filter($args) { // Only apply the filter for non-admin users if (!current_user_can('manage_options')) { // Specify the member type you want to display $desired_member_type = 'your_member_type'; // Set the member_type argument to filter the members list $args['member_type'] = $desired_member_type; } return $args; } add_filter('bp_after_has_members_parse_args', 'wbcom_custom_bp_members_filter');In reply to: BuddyPress Profile EditPossible caching issue.
You can check these docs, WP Fields can be used as xProfile fields https://bpdevel.wordpress.com/tag/wordpress/
In reply to: Buddypress and Restrict Content Pro MembershipYou can use the following code snippet to create a new tab to display at BuddyPress Profile.
// Function to add a custom tab for Membership Details in the BuddyPress profile function wbcom_rcp_buddypress_add_membership_tab() { global $bp; // Define a new navigation item for the BuddyPress profile menu bp_core_new_nav_item(array( 'name' => __('Membership', 'textdomain'), // The name of the tab 'slug' => 'membership', // The slug for the tab, used in the URL 'screen_function' => 'wbcom_rcp_buddypress_membership_screen', // The function that will load when the tab is clicked 'position' => 50, // Position of the tab in the profile navigation 'parent_url' => bp_loggedin_user_domain() . '/membership/', // The parent URL for this sub-navigation 'parent_slug' => $bp->profile->slug, // The slug of the parent navigation item 'default_subnav_slug' => 'membership' // Default sub-navigation slug )); } // Function to handle the display of the Membership Details tab content function wbcom_rcp_buddypress_membership_screen() { // Add the title and content to the Membership tab using actions add_action('bp_template_title', 'wbcom_rcp_buddypress_membership_screen_title'); add_action('bp_template_content', 'wbcom_rcp_buddypress_membership_screen_content'); // Load the BuddyPress plugin template for displaying the tab content bp_core_load_template(apply_filters('bp_core_template_plugin', 'members/single/plugins')); } // Function to set the title of the Membership Details tab function wbcom_rcp_buddypress_membership_screen_title() { echo 'Membership Details'; // Title displayed on the Membership tab } // Function to display the content of the Membership Details tab function wbcom_rcp_buddypress_membership_screen_content() { // Use the shortcode [subscription_details] to display membership information echo do_shortcode('[subscription_details]'); } // Hook the function to add the Membership tab into the BuddyPress setup navigation action add_action('bp_setup_nav', 'wbcom_rcp_buddypress_add_membership_tab');You can use a plugin to add code snippets to your WordPress website using a plugin like “Code Snippets.” This plugin allows you to add custom PHP code snippets to your site without editing your theme’s functions.php file.
In reply to: Profile picture issue@fourbfb you can try to debug with the following steps.
1- Temporarily deactivate other plugins to rule out conflicts, as another plugin might interfere with BuddyPress’s upload functionality.
2- Switch to a default WordPress theme like Twenty Twenty to check if the issue is theme-related.
3- Verify PHP settings such as upload_max_filesize and post_max_size are adequate in your php.ini file.
4- Use the browser’s developer console (F12) to check for JavaScript errors that might block the upload process.
5- Ensure that the profile photo and group icon uploads are enabled in BuddyPress settings.In reply to: Is BuddyPress compatible with Ultimate Member?Either Ultimate Member or BuddyPress; you can not use both together.
In reply to: Activity ‘Load More’ strange behaviour๐ Depending on your website’s plugins, theme, and any custom BuddyPress codes. BuddyX is ready for BPv12+ it does not need BP Classic. All our plugins are also ready for BPv12+.
In reply to: Activity ‘Load More’ strange behaviourHi @johnsimpson64, the latest version of BP (v12.2.0) was released yesterday. You can give it a try and test it again. At my end, I wasn’t able to replicate the issue you were facing with the “load more” feature – it seems to be working fine. However, I suggest that you try deactivating all custom codes related to BP and other BP plugins on your staging site, as they may contain outdated code that could be causing the issue.
@thesun2012 bp_legacy_theme_ajax_messages_star_handler is not mandatory; you can also create your custom handler based on it
for examplefunction wbcom_custom_buddypress_ajax_handler() { check_ajax_referer('custom-bp-ajax-nonce', 'security'); $displayed_user_id = isset($_POST['displayed_user_id']) && !empty($_POST['displayed_user_id']) ? (int) sanitize_text_field($_POST['displayed_user_id']) : get_current_user_id(); $message_id = isset($_POST['message_id']) ? (int) sanitize_text_field($_POST['message_id']) : 0; $star_status = isset($_POST['star_status']) ? sanitize_text_field($_POST['star_status']) : ''; $bulk = isset($_POST['bulk']) && !empty($_POST['bulk']); if (!bp_is_active('messages', 'star') || empty($message_id) || !is_user_logged_in() || !bp_core_can_edit_settings()) { wp_send_json_error(array('message' => 'Invalid request or insufficient permissions.')); return; } $result = bp_messages_star_set_action(array( 'action' => $star_status, 'message_id' => $message_id, 'bulk' => $bulk, 'user_id' => $displayed_user_id )); if ($result) { wp_send_json_success(); } else { wp_send_json_error(array('message' => 'Failed to update message status.')); } } add_action('wp_ajax_wbcom_custom_buddypress_action', 'wbcom_custom_buddypress_ajax_handler');AJAX Request Adjustments like this
jQuery.ajax({ url: ajaxurl, type: 'POST', data: { 'action': 'wbcom_custom_buddypress_action', 'displayed_user_id': displayedUserId, // Include if available 'message_id': messageId, 'star_status': starStatus, // Additional data... }, success: function(response) { // Handle success }, error: function(error) { // Handle error } });We can suggest modifying the bp_legacy_theme_ajax_messages_star_handler() function to handle the displayed user ID and use the logged-in user ID as a fallback.
function bp_legacy_theme_ajax_messages_star_handler() { if ( false === bp_is_active( 'messages', 'star' ) || empty( $_POST['message_id'] ) ) { return; } // Check nonce. check_ajax_referer( 'bp-messages-star-' . (int) $_POST['message_id'], 'nonce' ); // Check capability. if ( ! is_user_logged_in() || ! bp_core_can_edit_settings() ) { return; } // Get the displayed user ID or fallback to the logged-in user ID. $user_id = isset($_POST['displayed_user_id']) && !empty($_POST['displayed_user_id']) ? (int) $_POST['displayed_user_id'] : get_current_user_id(); if ( true === bp_messages_star_set_action( array( 'action' => $_POST['star_status'], 'message_id' => (int) $_POST['message_id'], 'bulk' => ! empty( $_POST['bulk'] ) ? true : false, 'user_id' => $user_id // Use the determined user ID ) ) ) { echo '1'; die(); } echo '-1'; die(); }@thesun2012 Use bp_loggedin_user_id() to tie the action of starring or unstarring a message to the user logged in and performing the action. This function returns the ID of the user who is currently logged into the site. When a user is viewing their profile, both bp_displayed_user_id() and bp_loggedin_user_id() will return the same user ID, as the “displayed user” and the “logged-in user” are the same person in this scenario.
In reply to: Activity ‘Load More’ strange behaviourTry to deactivate wp-ulike plugin and test again
In reply to: Lost memberlist and broken forumPlease follow following thread https://buddypress.org/support/topic/buddypress-12-1-1-maintenance-security-release/#post-332831
In reply to: Notify all group members@puresaian To mention all group members simultaneously, you must implement a custom solution. This could be a special shortcode or command that automatically translates into individual mentions for all group members when used by the admin.
/** * Handles the custom mention "@everyone" within BuddyPress groups. * When @everyone is used in a group's post or comment, it replaces it with mentions of all group members. */ function wbcom_custom_everyone_mention_handler( $content ) { // Check if BuddyPress is loaded and @everyone is used in the content if ( function_exists( 'groups_get_current_group' ) && strpos( $content, '@everyone' ) !== false ) { // Get the current group details $group = groups_get_current_group(); // Proceed only if we are in a group context if ( $group ) { // Fetch all members of the group $group_members = groups_get_group_members( array( 'group_id' => $group->id ) ); $mentions = array(); // Loop through each member to build the mentions array foreach ( $group_members['members'] as $member ) { $mentions[] = '@' . $member->user_nicename; // Prepares the mention syntax for each member } // Replace @everyone in the content with the individual member mentions $content = str_replace('@everyone', implode(' ', $mentions), $content); } } // Return the modified (or unmodified, if no changes were made) content return $content; } // Add filters to apply the custom mention handler in different BuddyPress content types add_filter( 'the_content', 'wbcom_custom_everyone_mention_handler' ); // For regular WordPress content add_filter( 'bp_activity_new_update_content', 'wbcom_custom_everyone_mention_handler' ); // For new BuddyPress activity updates add_filter( 'bp_activity_comment_content', 'wbcom_custom_everyone_mention_handler' ); // For comments on BuddyPress activitiesIt’s not a tested code; it’s just giving implementation directions.
In reply to: Error with latest update (BP and Youzify)@investbuddy123 Based on your description of issues with BuddyPress on your WordPress site, you’re encountering problems with group updates and public messaging functionalities.
Here is a step-by-step guide to debug the issue:
Check for Plugin Conflicts: Deactivate all plugins except BuddyPress and BP Classic. If the issue is resolved, reactivate each plugin individually to identify the conflicting plugin.
Theme Compatibility: You’ve tried switching to the Twenty-Three theme with no success, which is good. It rules out theme-specific issues.
Inspect JavaScript Errors: Use the browser’s Developer Tools (usually accessible by pressing F12) to check for JavaScript errors in the Console tab. JavaScript issues often cause features like loading updates or activating functions to fail.
Server and PHP Error Logs: Check your server and PHP error logs for any relevant errors. Your hosting provider can assist you in accessing these if you’re unsure how.
Test on a Staging Site: If possible, clone your site to a staging environment. This allows you to test without affecting your live site.
Cache and Optimization Plugins: If you use caching or optimization plugins, clear the cache and temporarily disable them to see if they are causing the issue.
Check for Custom Code: If you have any custom code (like snippets in your theme’s functions.php file or a custom plugin), comment to see if it is causing the issue.
In reply to: Restoring Tables@charlespauli, The best method for repairing a table involves utilizing a site backup from your hosting service. Alternatively, if the goal is only to reconstruct missing tables, setting up a new local installation and identifying the absent tables is a good approach. Once these tables are placed, export their SQL file code to recreate the missing tables.
In reply to: Missing Footer@ceraus, Please submit a support ticket at wbcomdesigns.com, and we will investigate the issue. It could be caused by a specific plugin, widget, or deprecated code.
You can check this out might be useful https://wbcomdesigns.com/downloads/buddyvendor/
In reply to: BuddyPress profile pageYou can add new profile fields from the backend settings for user profiles like age, location, and bio https://codex.buddypress.org/administrator-guide/extended-profiles/
For media support, you can use https://wordpress.org/plugins/bp-attachments/ plugin.
In reply to: Change the group name to the section name@abdallahgh You can change or rename Group to Sections using translation; try the loco translate plugin. https://codex.buddypress.org/getting-started/customizing/customizing-labels-messages-and-urls/
@wingflap bbPress still contains old codes that need an update; tickets are already created at the bbPress Trac. As a temporary solution, you can rename slug from the bbPress setting for favorite as it conflicts with BuddyPress favorite slug and then try again.
In reply to: Strange issue with bp_core_get_user_domainThe user Switching plugin needs an update to be compatible with the latest BP v12+. You can install the BP Classic plugin for now to add support for that plugin that is still using old codes. https://wordpress.org/plugins/bp-classic/
In reply to: BuddyPress 12.0.0@priyam1234 as an immediate solution, you can define the following inside wp-config.php
define('BP_LOAD_DEPRECATED', true);You can place this line anywhere in the wp-config.php file, but itโs typically a good practice to add it just before the line that says
/* That's all, stop editing! Happy publishing. */.In reply to: error with latest updatedefine('BP_LOAD_DEPRECATED', true);You can place this line anywhere in the wp-config.php file, but it’s typically a good practice to add it just before the line that says
/* That's all, stop editing! Happy publishing. */.In reply to: HTML entities in the private message titlenot able to replicate issue https://prnt.sc/gJKLLzt-Z5NE
In reply to: Assigning Pages@adri1987 BuddyPress v12 has introduced them as a custom post type, and regular mapped pages have been removed. You can now find a new section named ‘BuddyPress Directories’ in the menu to add them to your website’s menu. Please refer to the following document for more information.
https://github.com/buddypress/buddypress/blob/master/docs/user/administration/navigations/README.md
https://github.com/buddypress/buddypress/blob/master/docs/user/administration/settings/urls.md