Search Results for '+.+default+.+'
-
Search Results
-
It seems this is a known issue for WordPress when ordering by meta query. BBPress does this to order by “last active” which is the default (and in my case, desired).
Loading a forum index, on my site, takes about 20 seconds.
Here is the offending SQL:
[9] => Array ( [0] => SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) WHERE 1=1 AND wp_posts.post_parent = 9 AND wp_posts.post_type = 'topic' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'closed' OR wp_posts.post_status = 'private' OR wp_posts.post_status = 'hidden') AND (wp_postmeta.meta_key = '_bbp_last_active_time' ) GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value DESC LIMIT 0, 15 [1] => 19.448324918747 [2] => require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), apply_filters('template_include'), call_user_func_array, bbp_template_include, apply_filters('bbp_template_include'), call_user_func_array, bbp_template_include_theme_compat, BBP_Shortcodes->display_forum, bbp_get_template_part, bbp_locate_template, load_template, require('/themes/xx/bbpress/content-single-forum.php'), bbp_has_topics, WP_Query->__construct, WP_Query->query, WP_Query->get_posts )There’s a ticket which seems to be addressing my problem here: https://bbpress.trac.wordpress.org/ticket/1925
Unless I’m misreading it, the upshot is “We should probably be using post_modified on the topic instead of a meta value for ‘last activity’, so as to avoid using the JOIN… but we haven’t yet”.
So how do other sites do it? This one, for instance? Or WordPress.org? They have more posts than I do, but have got around this issue somehow.
Any solution?
Thanks.
Topic: Custom Roles & Capabilities
Hello Everyone,
So I’ve been working to get some custom permissions setup for our site and are running into some issues…I’ve followed the document located here and in turn have added the following code to my functions.php file in my child theme:
//code to add members and board roles function add_new_roles( $bbp_roles ) { /* Add a role called member */ $bbp_roles['bbp_member'] = array( 'name' => 'Member', 'capabilities' => custom_capabilities( 'bbp_member' ) ); /* Add a role called board */ $bbp_roles['bbp_board'] = array( 'name' => 'Board Member', 'capabilities' => custom_capabilities( 'bbp_board' ) ); 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_member' ) $caps = custom_capabilities( $role ); if( $role == 'bbp_board' ) $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 'Member' role */ 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' => 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, ); /* Capabilities for 'Board Member' role */ case 'bbp_board': return array( // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => true, 'throttle' => true, 'view_trash' => false, // 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, ); break; default : return $role; } }The problem I am running into is that the bbp_member role can’t seem to read and private topics, even though I have that capability set to true…? The bbp_board role works just as expected and in playing with the bbp_member role it seems to come down to the “moderate” capability…which I really don’t want on for our regular members.
Any help on this would be greatly appreciated.
I have the latest versions of WP, bbPress and BuddyPress installed.
Thank you
Hi,
I am new to BBPress so please be gentle š
When I want to make a post sticky in one forum and click on the ‘Stick (To Front)’ option at the bottom of post it defaults to making it super sticky and therefore appears in every forum. Is there anyway to have a button that just makes the post sticky instead of super sticky?
[IMG]http://i57.tinypic.com/epj6dd.jpg[/IMG]
Topic: Change order of attachments
I would like to change default order of attachment which are displayed in order of they are uploaded. Can I change it somehow?