Search Results for 'code'
-
AuthorSearch Results
-
September 18, 2015 at 11:09 am #166835
In reply to: Typo on the bbPress website…
Robkk
ModeratorHaha! I did not even edit/create this page before. đ
Alright, thanks for pointing that out. I just now changed the errors you pointed out for now, but this guide might be completely rewritten later because it does contain information that is similar to/that should be in the theme compatibility guide.
And it kind of has information that might be in this guide later when it is finished.
The amending templates guide might be a comprehensive guide all about customizing the templates/creating custom templates/customizing how theme compatibility works, and not necessarily about just copying the templates in your theme and knowing that you can customize it.
September 18, 2015 at 9:35 am #166833In reply to: Typo on the bbPress website…
deanljbirch
ParticipantHey Robkk,
Thanks for getting back to me.
Link : https://codex.bbpress.org/themes/amending-bbpress-templates/ (Last paragraph 2nd word)
Deano đ
September 18, 2015 at 9:05 am #166830In reply to: Change meta/page title for user pages
Robkk
ModeratorIt is weird that you got this new issue. I just tested the snippet again on my WAMP server to check with the latest version of WordPress, switched to German again, and also see if it conflicts with the last code snippet I gave you, but I do not see an issue on my side.
September 18, 2015 at 8:37 am #166829Topic: How to add user profile link to specific menu?
in forum Troubleshootingdayan89
ParticipantHi,
I have two menu areas on my website: main and top. I would like to add user profile link to top menu only.
I found this example, which was were useful: https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#8-add-edit-profile-to-a-wordpress-menu But it adds link to both menus, top and main. I would like to add user profile link only to top menu, without adding it to main menu.

Can you help me please?
September 18, 2015 at 7:57 am #166828In reply to: Change meta/page title for user pages
project_subdomain
Participantjust had the problem that on all not bbpress-related pages the title was ” ‘s “.
When commenting out the part for “User is viewing someone else’s profile” it’s working correctly on all pages, also when viewing another profile:else { $new_title['text'] = sprintf( esc_attr_x( "%s's", 'User viewing another users profile', 'bbpress' ), get_userdata( bbp_get_user_id() )->display_name ); }fyi new occurred, just had a wordpress update recently
September 18, 2015 at 7:38 am #166827In reply to: My replies and my topics: Detected by the user’s IP?
project_subdomain
ParticipantUPDATE: sorry, thought code is causing the browser’s title as ” ‘s” on all non-bbpress-related pages. need to find the reason which does not seem to be in relation to this topic.
September 17, 2015 at 11:08 pm #166825Topic: Is it possible to loop bbp_register_view ?
in forum Troubleshootingwpman
ParticipantI have a taxonomy:location
I try to register views for all terms.but it doesn’t work.
function taxonomy_custom_views() {
$args = array('orderby'=>'asc','hide_empty'=>true);
$terms = get_terms(array('location'), $args);
foreach($terms as $term){
$location_term=$term->slug ;
$location_name=$term->name ;
bbp_register_view( $location_term , __( $location_name ),array('tax_query' => array(array('taxonomy' => 'location','field' => 'slug','terms' => $location_term,),),), false );
}
}
add_action( 'bbp_register_views', 'taxonomy_custom_views' );
September 17, 2015 at 6:12 pm #166820In reply to: Groups and Forums
Robkk
Moderator[bbp-topic-form forum_id=$forum_id] â Display the âNew Topic Formâ for a specific forum ID.
September 17, 2015 at 5:59 pm #166819In reply to: Recently edited replies to the top
project_subdomain
Participantto prevent showing all users’ replies in ‘my replies’ this code works instead, which robkk wrote:
function custom_bbp_has_replies( $args ) { if ( bbp_is_single_topic() && !bbp_is_single_user() ) { $args['orderby'] .= 'post_modified'; $args['order'] .= 'DESC'; } return $args; } add_filter('bbp_before_has_replies_parse_args', 'custom_bbp_has_replies' );September 17, 2015 at 5:59 pm #166818Topic: displaying all topics from a category
in forum Showcaselfeddern
ParticipantHi,
I have a catagory with several different forums in it. I would like to display the most recent topics from the category. Am I right in thinking there is no shortcode that allows this?
Could I achieve this by just getting them to display some how by forum id? If I have to query the latest topics from certain forums which function would I have to use? I have looked at the docs but the functions don’t seem to be documented.
Thanks for any help;
September 17, 2015 at 5:46 pm #166817In reply to: My replies and my topics: Detected by the user’s IP?
project_subdomain
Participantgreat, it’s working! thank you so much – really saved my day (night already)! just had to change some brackets. so this is working:
function custom_bbp_has_replies( $args ) { if ( bbp_is_single_topic() && !bbp_is_single_user() ) { $args['orderby'] .= 'post_modified'; $args['order'] .= 'DESC'; } return $args; } add_filter('bbp_before_has_replies_parse_args', 'custom_bbp_has_replies' );September 17, 2015 at 5:23 pm #166816In reply to: Groups and Forums
chigoziekyrian
ParticipantThanks for your reply, please where can i get the forum specific topic form short code, do you have or know it? because i haven’t seen it before.. thanks
Robkk
ModeratorMoved your reply to here since it is related to the topic you created earlier.
You cannot move additional replies to a subforum by default or with a plugin I know. You may need to consider hiring a developer for to create this for you.
Since I think you basically said the topic gets hidden in all the replies. You can use this function to always display the topic no matter what page you are on like how these forums have by default.
function custom_bbp_show_lead_topic( $show_lead ) { $show_lead[] = 'true'; return $show_lead; } add_filter('bbp_show_lead_topic', 'custom_bbp_show_lead_topic' );September 17, 2015 at 4:11 pm #166807Robkk
ModeratorWell there are these if you do not have show topic lead enabled.
add_action( 'bbp_theme_before_reply_content', 'function_name' ); add_action( 'bbp_theme_after_reply_content', 'function_name' );You may need to use a conditional to only display your value on the first reply/topic if they have the same ID.
if ( bbp_get_reply_id() == bbp_get_topic_id() ) {September 17, 2015 at 3:54 pm #166805In reply to: Html tags showing up in topics & replies
Robkk
ModeratorDoes this PHP function help any?? Place this code in your child theme or funcitonality plugin.
function bbp_tinymce_paste_plain_text( $plugins = array() ) { $plugins[] = 'paste'; return $plugins; } add_filter( 'bbp_get_tiny_mce_plugins', 'bbp_tinymce_paste_plain_text' );September 17, 2015 at 3:49 pm #166803In reply to: My replies and my topics: Detected by the user’s IP?
project_subdomain
Participant@Robkk
thanks again for your effort!
Just had several tries after looking into the conditional tags also, it’s always saying that the user doesn’t have any replies to topics created yet.
Also made sure now the code of the related topic-link is causing displaying all user’s replies.September 17, 2015 at 3:20 pm #166798In reply to: My replies and my topics: Detected by the user’s IP?
Robkk
ModeratorI think this is somewhat related to your other topic here.
I guess you have to make sure the reply sorting is only working on the single topics and not the user profile pages.
You can try something like this to see if it works. You may not even need the second conditional bbp_is_single_user() but I was making sure.
function custom_bbp_has_replies( $args ) { if ( bbp_is_single_topic{} && !bbp_is_single_user() ) { $args['orderby'] .= 'post_modified'; $args['order'] .= 'DESC'; } return $args; } add_filter('bbp_before_has_replies_parse_args', 'custom_bbp_has_replies' );' );Since I am not 100% sure that I have the right conditionals since I haven’t tested this you can double check here.
September 17, 2015 at 3:05 pm #166795In reply to: Installed but no editor visible
Robkk
ModeratorIt is missing on the frontend of your site on the topic and reply forms right??
Did you make sure you have the Post Formatting enabled in Settings > Forums?
You can also see if it is a plugin issue by trying some troubleshooting. You can also see if you have some code snippet in your theme by switching to a default theme temporarily to see if it fixes the issue.
September 17, 2015 at 12:24 pm #166791In reply to: Setting New Role Upon Login with iMember360 Plugin
davellan
ParticipantStackoverflow came to the rescue, and I have this question to thank for it.
If you read all the comments, it gets to the solution, which in my case was this code.
function i4w_authenticated_remote_login_action($user, $contact) { global $SESSION; IF ($arrTAGS = explode(',', $SESSION['i4wuser']['Groups'])) : IF (in_array(38181, $arrTAGS) || in_array(38185, $arrTAGS) || in_array(38193, $arrTAGS)) : $user_id = get_current_user_id(); $new_role_forum_role="bbp_participant"; bbp_set_user_role( $user_id, $new_role_forum_role ); $wp_user_capabilities_arr = array("subscriber" => true, "bbp_participant" => true, "bbp_spectator" => false); update_user_meta($user_id, "wp_capabilities", $wp_user_capabilities_arr); ELSEIF (in_array(38177, $arrTAGS) || in_array(38195, $arrTAGS) || in_array(38183, $arrTAGS) || in_array(38187, $arrTAGS) || in_array(38189, $arrTAGS)) : $user_id = get_current_user_id(); $new_role_forum_role=âbbp_spectatorâ; bbp_set_user_role( $user_id, $new_role_forum_role ); $wp_user_capabilities_arr = array("subscriber" => true, "bbp_spectator" => false); update_user_meta($user_id, "wp_capabilities", $wp_user_capabilities_arr); ENDIF; ENDIF; } add_filter('i4w_authenticated_remote_login', 'i4w_authenticated_remote_login_action', 1, 2);I am a bit confused as to why I needed to use the update_user_meta to remove the additional capabilities (or why I would have had additional capabilities generated from the bbp_set_user_role function). If someone could answer that it would be greatly appreciated, as I am sure this code is not 100% efficient.
September 17, 2015 at 2:47 am #166755In reply to: My replies and my topics: Detected by the user’s IP?
project_subdomain
ParticipantSolved it, maybe it’s helping others as well.
It’s been caused by a custom code in my functions that did sort the replies and with which I had no problems so far. As bbpress now has this reply order feature integrated, it has not only become redundant but conflicting. First appearing when I star to use bbpress’ integrated reply order feature, resulting in showing all replies of a users as “my replies” instead of the user’s only.So without looking into the code I’m assuming it’s detected by the user’s ID as usual.
September 16, 2015 at 1:11 pm #166740In reply to: Forum not recognizing logged-in members
Robkk
ModeratorIt could be a caching plugin or just cache in general. You may need to clear the cache on your site to see if everything works out well. Just deactivating a cache plugin will not clear whatever cache is still saved on your site.
September 16, 2015 at 1:09 pm #166739Robkk
ModeratorTry to see if it could be a plugin issue, like a spam plugin scanning a reply before it is posted or something.
It could also be the bbPress subscriptions hogging everything down. This plugin will hopefully help things out.
https://wordpress.org/plugins/asyncronous-bbpress-subscriptions/
Robkk
ModeratorTry to see if it is a plugin issue, a code snippet in your child theme causing the issue.
September 16, 2015 at 12:53 pm #166733In reply to: members cannot reply to topics
Robkk
ModeratorTry a default theme, disable all plugins except bbPress, and hopefully you didn’t try to modify the roles and permissions.
September 16, 2015 at 12:47 pm #166731In reply to: bbPress tweaks – questions
Robkk
Moderator1) Are Private forums visible to all logged in users? I thought for sure it restricted access to only moderators and keymasters, but when I did some testing I noticed theyâre very much visible. I didnât see anything about it in the Layout and Funcionality article, so any tips on having a truly private forum for me and my forum staff?
Hidden Forums are only seen by Mods and Keymasters. Layout and Functionality article is basically a code snippet collection not something explaining how bbPress works.
The information you need to know are somewhat in here.
2) I wanted to prevent users changing their display name, so they would be forced to display themselves as whatever their username is, however, when editing form-user-edit.php they still had access to do so in the WP-Admin. Following the steps in Restricting access to WP Admin did nothing. The WP Admin Bar was still visible, and Participants or lower still have access to it.
-
AuthorSearch Results