Search Results for 'code'
-
Search Results
-
Hey there,
after having recently started with bbpress 2.5.4 and WP 4.1, I ran into a “404” problem after having created forum and topic as per the step-by-step directive (using method #2 with shortcode).
Right from the start, a “404” appeared when startgin from the forum index page (the one with the shortcode). I spent the last 40 hrs reading and trying the various proposed fixes, none worked.
However, deactivating the installed plugins and trying did point to WooCommerce Multilingual
being the culprit, since the forums, subforums, categories, topics work fine when WC Mutlilingual is deactivated. If WC ML is activated, the same URL (using “postname”) is crashing to a “404”.I somebody has run into similar problem and/or a diagnosis on what the reason is-
or even better can provide the magic fix, please step up and collect the praise… I myself m at the very end of my wits and carry a dangerous 1/8 knowledge about what I am doing…Cheers,
O.Topic: Need help with custom roles
Hi
This is my third time trying to post here hopefully it sticks this time.
I am trying to add some custom roles to the bbpress forums and I have followed the Custom Capabilities codex page.
It doesn’t appear to be working as intended though as I cannot give myself the owner role
I would like these roles in bbpress to sync with some custom wp roles made with the members plugin.
sorry for the wall of text below but its an effort to get this topic posted (i had links in the previous topics)
here is what i have in my child themes functions.php
// add bbPress Roles******************************************** function add_new_roles( $bbp_roles ) { /* Add a role called BlockFusion Owner */ $bbp_roles['bbp_owner'] = array( 'name' => 'BlockFusion Owner', 'capabilities' => custom_capabilities( 'bbp_owner' ) ); /* Add a role called Co-Owner */ $bbp_roles['bbp_co_owner'] = array( 'name' => 'Co-Owner', 'capabilities' => custom_capabilities( 'bbp_co_owner' ) ); /* Add a role called Admin */ $bbp_roles['bbp_admin'] = array( 'name' => 'Admin', 'capabilities' => custom_capabilities( 'bbp_admin' ) ); /* Add a role called Moderator */ $bbp_roles['bbp_moderator'] = array( 'name' => 'Moderator', 'capabilities' => custom_capabilities( 'bbp_moderator' ) ); /* Add a role called Member */ $bbp_roles['bbp_member'] = array( 'name' => 'Member', 'capabilities' => custom_capabilities( 'bbp_member' ) ); /* Add a role called Guest */ $bbp_roles['bbp_guest'] = array( 'name' => 'Guest', 'capabilities' => custom_capabilities( 'bbp_guest' ) ); 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_owner' ) $caps = custom_capabilities( $role ); if( $role == 'bbp_co_owner' ) $caps = custom_capabilities( $role ); if( $role == 'bbp_admin' ) $caps = custom_capabilities( $role ); if( $role == 'bbp_moderator' ) $caps = custom_capabilities( $role ); if( $role == 'bbp_member' ) $caps = custom_capabilities( $role ); if( $role == 'bbp_guest' ) $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 ) { /* Capabilities for 'BlockFusion Owner' role */ case 'bbp_owner': return array( // Keymasters only 'keep_gate' => true, // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => true, 'throttle' => true, 'view_trash' => true, // Forum caps 'publish_forums' => true, 'edit_forums' => true, 'edit_others_forums' => true, 'delete_forums' => true, 'delete_others_forums' => true, 'read_private_forums' => true, 'read_hidden_forums' => true, // Topic caps 'publish_topics' => true, 'edit_topics' => true, 'edit_others_topics' => true, 'delete_topics' => true, 'delete_others_topics' => true, 'read_private_topics' => true, // Reply caps 'publish_replies' => true, 'edit_replies' => true, 'edit_others_replies' => true, 'delete_replies' => true, 'delete_others_replies' => true, 'read_private_replies' => true, // Topic tag caps 'manage_topic_tags' => true, 'edit_topic_tags' => true, 'delete_topic_tags' => true, 'assign_topic_tags' => true, ); /* Capabilities for 'Co-Owner' role */ case 'bbp_co_owner': return array( // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => true, 'throttle' => true, 'view_trash' => true, // Forum caps 'publish_forums' => true, 'edit_forums' => true, 'edit_others_forums' => true, 'delete_forums' => true, 'delete_others_forums' => true, 'read_private_forums' => true, 'read_hidden_forums' => true, // Topic caps 'publish_topics' => true, 'edit_topics' => true, 'edit_others_topics' => true, 'delete_topics' => true, 'delete_others_topics' => true, 'read_private_topics' => true, // Reply caps 'publish_replies' => true, 'edit_replies' => true, 'edit_others_replies' => true, 'delete_replies' => true, 'delete_others_replies' => true, 'read_private_replies' => true, // Topic tag caps 'manage_topic_tags' => true, 'edit_topic_tags' => true, 'delete_topic_tags' => true, 'assign_topic_tags' => true, ); /* Capabilities for 'Admin' role */ case 'bbp_admin': return array( // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => true, 'throttle' => true, 'view_trash' => true, // 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' => true, // Topic caps 'publish_topics' => true, 'edit_topics' => true, 'edit_others_topics' => true, 'delete_topics' => true, 'delete_others_topics' => true, 'read_private_topics' => true, // Reply caps 'publish_replies' => true, 'edit_replies' => true, 'edit_others_replies' => true, 'delete_replies' => true, 'delete_others_replies' => true, 'read_private_replies' => true, // Topic tag caps 'manage_topic_tags' => true, 'edit_topic_tags' => true, 'delete_topic_tags' => true, 'assign_topic_tags' => true, ); /* Capabilities for 'Moderator' role */ case 'bbp_moderator': return array( // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => true, 'throttle' => true, 'view_trash' => true, // 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' => true, // Topic caps 'publish_topics' => true, 'edit_topics' => true, 'edit_others_topics' => true, 'delete_topics' => true, 'delete_others_topics' => true, 'read_private_topics' => true, // Reply caps 'publish_replies' => true, 'edit_replies' => true, 'edit_others_replies' => true, 'delete_replies' => true, 'delete_others_replies' => true, 'read_private_replies' => true, // Topic tag caps 'manage_topic_tags' => true, 'edit_topic_tags' => true, 'delete_topic_tags' => true, 'assign_topic_tags' => true, ); /* Capabilities for 'Member' role */ case 'bbp_member': return array( // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => false, 'throttle' => true, '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' => true, 'delete_others_topics' => false, 'read_private_topics' => true, // Reply caps 'publish_replies' => true, 'edit_replies' => true, 'edit_others_replies' => false, 'delete_replies' => true, 'delete_others_replies' => false, 'read_private_replies' => true, // Topic tag caps 'manage_topic_tags' => true, 'edit_topic_tags' => true, 'delete_topic_tags' => true, 'assign_topic_tags' => true, ); /* Capabilities for 'Guest' role */ case 'bbp_guest': return array( // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => false, 'throttle' => true, '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' => true, 'delete_others_topics' => false, 'read_private_topics' => true, // Reply caps 'publish_replies' => true, 'edit_replies' => true, 'edit_others_replies' => false, 'delete_replies' => true, 'delete_others_replies' => false, 'read_private_replies' => true, // Topic tag caps 'manage_topic_tags' => true, 'edit_topic_tags' => true, 'delete_topic_tags' => true, 'assign_topic_tags' => true, ); break; default : return $role; } }Sorry to ask such a silly question, but I cannot seem to find info on them other than the http://codex.bbpress.org/shortcodes/ page. I have an idea of what they are, I’m just not sure how exactly to use them. It explains on that page that I just insert them into my desired page, but does not elaborate on that. I was hoping to find an article somewhere that goes over them in detail, but have yet to find it. So, I’ve decided to make a noob post here the bbpress forums.
I need create a query to bring the list of forums and subforums on the homepage of my website, i woudn’t like to use shortcodes cuz i want create a custom style. I did a wp-query but i can’t use functions to show the topic, replies and posts quantity.
<?php $args = array( 'post_type' => 'forum', 'order' => 'DESC', 'orderby' => 'date' ); $query = new WP_Query($args); ?> Foruns| Posts <?php if( $query -> have_posts() ): ?> <?php while ($query -> have_posts() ) : $query -> the_post(); ?> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"> <?php the_title(); ?> </a> <?php $value = bbp_get_forum_post_count(); echo $value; ?> <?php endwhile; ?> <?php wp_reset_postdata(); ?> <?php else: ?> Nothing yet... <?php endif; ?>Thanks for help.
Hi!
How to make the bbpress content show in wordpress search? I create a custom search:<div class="col-md-8 col-md-offset-4 searchform-top" id="searchform-top"> <form class="input-group" role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>"> <input class="form-control input-block" id="appendedInputButton" type="text" placeholder="Buscar no site" name="s" id="s"> <span class="input-group-btn"> <button class="btn btn-primary" type="submit" id="searchsubmit">Buscar</button> </span> </form> </div>But bbpress results not appear when i search it.