Search Results for 'code'
-
Search Results
-
WordPress version 5.8
BuddyPress version 9.0.0
bbPress version 2.6.6I have attempted to import from BuddyPress by going to Tools > Forums, Import Forums. I entered all of the needed information and clicked Start. The progress box reported nothing was imported, but our BuddyPress Groups has 1 forum with a fair number of messages.
I found documentation at https://codex.bbpress.org/getting-started/importing-data/import-forums/bbpress-1-x-buddypress-group-forums/ which purports to be documentation for importing from BuddyPress groups but only links to what appears to be a possibly out-of-date article about importing from an older version of bbPress.
What is the best method to migrate from BuddyPress 9.0 to bbPress 2.6.6?
Topic: Ultimate Member integration
I’m trying to move “Favorites” page to Ultimate Member Profile page by running
bbp_get_template_part( 'user', 'favorites' );
on that page, but I get “Nothing to show” message. Do I need to preload/initialize something before calling that? ThanksHi
I want to exclude “breadcrumb” from the topic list output screen of a specific forum.
i use to plugin’s bbp style pack, bbP shortcodes
thanks
I’m new to bbPress so please excuse what has been asked before, but a lot of the answers seem obsolete.
I’ve created several forums, with descriptions yet the descriptions never appear when a user views the forum. Various article I’ve read here suggest you have to go edit “your functions file” (see https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/) but when I search for bbpress.php, forum.php, etc. I can’t find them. There’s nothing under wp-content/themes/astra or anywhere else I can find. Anyone got any hints?
It’s frustrating that so much of the documentation on bbPress seems to have been written years ago and not necessarily updated as changes have been made.
My site is kusamurabonsai.org – but the forums are only visible to logged in users.
I’m running WP 5.7.2 and bbPress 2.6.6Topic: Forum “root” issues
I’m having problems with the root of the forum board.
I have the forum root slug(s) setup exactly as the installation instructions recommend:
-forum root = forums
-forum prefix is checked
-the root shows “forum index”
-forum single slug = forumI created a page with the slug forum and the shortcode added to it. When you go to the page, the forums shows exactly as it should. However, let’s say you have the following showing in breadcrumbs:
Home>Forums>Discussion
When you click on “forums” to go back one (e.g. the main page for the forum) it produces a paragraph of content with the forums listed in it. You cannot get back to the main board, unless you click on a link that contains the forum slug (.e. https://mysite.com/forum)
Can anyone help me on what I’m doing wrong. I’ve tried different things to see if I could manipulate it, including swapping the root and single slugs, unchecking the prefix, changing what the root shows, etc. I’ve even changed the page slug to forums instead of forum, and it does the same thing. Instead of showing the main forum board, it gives this paragraph summary of topics and forums the board contains.
Hi, i’ve searched a lot but i didn’t find any answer. On bbpress website i’ve built 2 differnt type of forum, 1 is private and 1 is public. Now i need to deny access only to public forum to a certain wp user role (already set).
I think i have two ways, but how to do them?
1. Turn public forum to a private forum and automatically assign to a every new-subscriber the access to this forum, so i can exclude user assign them a different role.
2. Block the access only to public forum to a certain role (i’ve tried with many plugins as content control or user access registration but it seems that doesn’t work.)Any suggestions? Even php code to implement for me would be ok. Thanks.
Wordpress 5.7.2
BBPress 2.6.6Any help would be greatly appreciated!! I am at my wits end trying to figure this out….
I would like to get people automatically redirected to a page inside the forum instead of the WP dashboard, but it is not working. Here is what I have done so far:
1. After they are accepted into the program, they are sent to our register page: https://arianegoodwin.com/curiosity-cocktails-register-here/
2. I did figure out redirect code for after they register so they see this page:
(this is the code snippet I used for this):
// Redirect Registration Page
function my_registration_page_redirect()
{
global $pagenow;// Standard Registration Redirect
if ( (strtolower($pagenow) == ‘wp-login.php’) && (strtolower($_GET[‘action’]) == ‘register’) ) {
wp_redirect( home_url(‘/register/’) );
}// Redirection after successful registration
if ( (strtolower($pagenow) == ‘wp-login.php’) && (strtolower($_GET[‘checkemail’]) == ‘registered’) ) {
wp_redirect( home_url(‘/forums/log-in/’) );
}
}add_filter( ‘init’, ‘my_registration_page_redirect’ );
3. After they click on the link in their email to create their password, they are getting sent to the WP Dashboard and I need them to go to this page instead:
I have tried using Peters Login Redirect and that has not worked. I have also tried using this code inside the Snippets, which isn’t working either:
// Send new users to a special page
function redirectOnFirstLogin( $custom_redirect_to, $redirect_to, $requested_redirect_to, $user )
{
// URL to redirect to
$redirect_url = ‘https://arianegoodwin.com/forums/curiosity-cocktails-topic-map/’;
// How many times to redirect the user
$num_redirects = 1;
// If implementing this on an existing site, this is here so that existing users don’t suddenly get the “first login” treatment
// On a new site, you might remove this setting and the associated check
// Alternative approach: run a script to assign the “already redirected” property to all existing users
// Alternative approach: use a date-based check so that all registered users before a certain date are ignored
// 172800 seconds = 48 hours
$message_period = 172800;/*
Cookie-based solution: captures users who registered within the last n hours
The reason to set it as “last n hours” is so that if a user clears their cookies or logs in with a different browser,
they don’t get this same redirect treatment long after they’re already a registered user
*/
/*$key_name = ‘redirect_on_first_login_’ . $user->ID;
if( strtotime( $user->user_registered ) > ( time() – $message_period )
&& ( !isset( $_COOKIE[$key_name] ) || intval( $_COOKIE[$key_name] ) < $num_redirects )
)
{
if( isset( $_COOKIE[$key_name] ) )
{
$num_redirects = intval( $_COOKIE[$key_name] ) + 1;
}
setcookie( $key_name, $num_redirects, time() + $message_period, COOKIEPATH, COOKIE_DOMAIN );
return $redirect_url;
}
*/
/*
User meta value-based solution, stored in the database
*/
$key_name = ‘redirect_on_first_login’;
// Third parameter ensures that the result is a string
$current_redirect_value = get_user_meta( $user->ID, $key_name, true );
if( strtotime( $user->user_registered ) > ( time() – $message_period )
&& ( ” == $current_redirect_value || intval( $current_redirect_value ) < $num_redirects )
)
{
if( ” != $current_redirect_value )
{
$num_redirects = intval( $current_redirect_value ) + 1;
}
update_user_meta( $user->ID, $key_name, $num_redirects );
return $redirect_url;
}
else
{
return $custom_redirect_to;
}
}add_filter( ‘rul_before_user’, ‘redirectOnFirstLogin’, 10, 4 );
Topic: Help with Forum Roles
Hello.
So i’m developing a tech website but for some reason i can’t make the created forum roles to appear on users.
Roles Created:
Member – Participant rules but can’t create topics, only reply to existent ones.
GCam Dev – with same permissions as Member but can create threads.
ROM Dev – with same permissions as Member but can create threads.
Kernel Dev – with same permissions as Member but can create threads.
Modder – with same permissions as Member but can create threads.I’ve been searching and used this code below for it:
//code to add tutor role function add_new_roles( $bbp_roles ) { $bbp_roles['bbp_gcamdev'] = array( 'name' => 'GCam Developer', 'capabilities' => custom_capabilities( 'bbp_gcamdev' ) ); $bbp_roles['bbp_romdev'] = array( 'name' => 'ROM Developer', 'capabilities' => custom_capabilities( 'bbp_romdev' ) ); $bbp_roles['bbp_kerneldev'] = array( 'name' => 'Kernel Developer', 'capabilities' => custom_capabilities( 'bbp_kerneldev' ) ); $bbp_roles['bbp_modder'] = array( 'name' => 'Modder', 'capabilities' => custom_capabilities( 'bbp_modder' ) ); $bbp_roles['bbp_member'] = array( 'name' => 'Member', 'capabilities' => custom_capabilities( 'bbp_member' ) ); return $bbp_roles; } add_filter( 'bbp_get_dynamic_roles', 'add_new_roles', 1 ); function add_role_caps_filter( $caps, $role ) { /* Only filter for roles we are interested in! */ if( $role == 'bbp_gcamdev' ) $caps = custom_capabilities( $role ); if( $role == 'bbp_romdev' ) $caps = custom_capabilities( $role ); if( $role == 'bbp_kerneldev' ) $caps = custom_capabilities( $role ); if( $role == 'bbp_modder' ) $caps = custom_capabilities( $role ); if( $role == 'bbp_member' ) $caps = custom_capabilities( $role ); return $caps; } add_filter( 'bbp_get_caps_for_role', 'add_role_caps_filter', 10, 2 ); function custom_capabilities( $role ) { switch ( $role ) { case 'bbp_gcamdev': return array( // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => false, 'throttle' => false, 'view_trash' => false, // Forum caps 'publish_forums' => false, 'edit_forums' => false, 'edit_others_forums' => false, 'delete_forums' => false, 'delete_others_forums' => false, 'read_private_forums' => true, 'read_hidden_forums' => false, // Topic caps 'publish_topics' => true, 'edit_topics' => true, 'edit_others_topics' => false, 'delete_topics' => false, 'delete_others_topics' => false, 'read_private_topics' => true, // Reply caps 'publish_replies' => true, 'edit_replies' => true, 'edit_others_replies' => false, 'delete_replies' => false, 'delete_others_replies' => false, 'read_private_replies' => true, // Topic tag caps 'manage_topic_tags' => false, 'edit_topic_tags' => false, 'delete_topic_tags' => false, 'assign_topic_tags' => true, ); case 'bbp_romdev': return array( // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => false, 'throttle' => false, 'view_trash' => false, // Forum caps 'publish_forums' => false, 'edit_forums' => false, 'edit_others_forums' => false, 'delete_forums' => false, 'delete_others_forums' => false, 'read_private_forums' => true, 'read_hidden_forums' => false, // Topic caps 'publish_topics' => true, 'edit_topics' => true, 'edit_others_topics' => false, 'delete_topics' => false, 'delete_others_topics' => false, 'read_private_topics' => true, // Reply caps 'publish_replies' => true, 'edit_replies' => true, 'edit_others_replies' => false, 'delete_replies' => false, 'delete_others_replies' => false, 'read_private_replies' => true, // Topic tag caps 'manage_topic_tags' => false, 'edit_topic_tags' => false, 'delete_topic_tags' => false, 'assign_topic_tags' => true, ); case 'bbp_kerneldev': return array( // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => false, 'throttle' => false, 'view_trash' => false, // Forum caps 'publish_forums' => false, 'edit_forums' => false, 'edit_others_forums' => false, 'delete_forums' => false, 'delete_others_forums' => false, 'read_private_forums' => true, 'read_hidden_forums' => false, // Topic caps 'publish_topics' => true, 'edit_topics' => true, 'edit_others_topics' => false, 'delete_topics' => false, 'delete_others_topics' => false, 'read_private_topics' => true, // Reply caps 'publish_replies' => true, 'edit_replies' => true, 'edit_others_replies' => false, 'delete_replies' => false, 'delete_others_replies' => false, 'read_private_replies' => true, // Topic tag caps 'manage_topic_tags' => false, 'edit_topic_tags' => false, 'delete_topic_tags' => false, 'assign_topic_tags' => true, ); case 'bbp_modder': return array( // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => false, 'throttle' => false, 'view_trash' => false, // Forum caps 'publish_forums' => false, 'edit_forums' => false, 'edit_others_forums' => false, 'delete_forums' => false, 'delete_others_forums' => false, 'read_private_forums' => true, 'read_hidden_forums' => false, // Topic caps 'publish_topics' => true, 'edit_topics' => true, 'edit_others_topics' => false, 'delete_topics' => false, 'delete_others_topics' => false, 'read_private_topics' => true, // Reply caps 'publish_replies' => true, 'edit_replies' => true, 'edit_others_replies' => false, 'delete_replies' => false, 'delete_others_replies' => false, 'read_private_replies' => true, // Topic tag caps 'manage_topic_tags' => false, 'edit_topic_tags' => false, 'delete_topic_tags' => false, 'assign_topic_tags' => true, ); case 'bbp_member': return array( // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => false, 'throttle' => false, 'view_trash' => false, // Forum caps 'publish_forums' => false, 'edit_forums' => false, 'edit_others_forums' => false, 'delete_forums' => false, 'delete_others_forums' => false, 'read_private_forums' => true, 'read_hidden_forums' => false, // Topic caps 'publish_topics' => false, 'edit_topics' => false, 'edit_others_topics' => false, 'delete_topics' => false, 'delete_others_topics' => false, 'read_private_topics' => true, // Reply caps 'publish_replies' => true, 'edit_replies' => true, 'edit_others_replies' => false, 'delete_replies' => false, 'delete_others_replies' => false, 'read_private_replies' => true, // Topic tag caps 'manage_topic_tags' => false, 'edit_topic_tags' => false, 'delete_topic_tags' => false, 'assign_topic_tags' => true, ); break; default : return $role; } }
The Forum Roles appear on the Users menu but when i select it and Save Changes the role is removed. Am i missing anything?