Thanks Pascal – I’m assuming the best code is:
function login_redirect( $redirect_to, $request, $user ){
return home_url(‘forums’);
}
add_filter( ‘login_redirect’, ‘login_redirect’, 10, 3 );
But to use registration (or register) instead of login?
I’ve pasted code into functions.php files, almost anywhere I can
There is only 1 (one) functions.php where you should paste it and that’s the one in your (child) theme.
all the solutions offered take me nowhere
I have put all the code that I have on https://bbpress.org/forums/topic/setup-login-for-private-forum/. If you only go for the code, then make sure to deactivate any other redirection and/or security plugins (at least for the test).
the site is at tec.selwood.me
You are missing the ‘Email’ label under the forgot your passsword on the log-in page
Pascal.
Ok, so I’m setting up my new bbPress forum and have come across a problem that I just can’t fix. It’s the redirection to the wp-login screen after registration. I’ve scoured these forums and all the solutions offered take me nowhere. I’ve installed 3rd party plugins (like Pete’s) but there is just no changing the redirect. I’ve pasted code into functions.php files, almost anywhere I can, but all it’s doing is going back to the damn wp-login page!
I am going insane here trying to make this work.
Latest WP version, latest Lincoln Education WP theme, latest bbPress version and the site is at tec.selwood.me
How can i display best rated forum post on my forum
and recent replies post, any plugin or code to do this… thanks in advance for help
@robkk kindly pls help me 🙂
change Administrator to an image.
bbp_get_keymaster_role() => array(
'name' => 'Administrator',
'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() )
),
found some code in the net but i don’t know where to insert it.
Ok, you need to amend some templates and put these into your child theme
https://codex.bbpress.org/functions-files-and-child-themes-explained/
Sub-forum removal
create a directory on your theme called ‘bbpress’
ie wp-content/themes/%your-theme-name%/bbpress
where %your-theme-name% is the name of your theme
find
wp-content/plugins/bbpress/templates/default/bbpress/loop-single-forum.php
Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
wp-content/themes/%your-theme-name%/bbpress/loop-single-forum.php
bbPress will now use this template instead of the original
and you can amend this to remove the sub forums
line 44 says <?php bbp_list_forums(); ?>
delete this line and the sub forums will go !
forum posts
do the same as above, but for content-single-forum
and then take out line 26 that says
<?php bbp_single_forum_description(); ?>
https://en-gb.wordpress.org/plugins/global-admin-bar-hide-or-remove/
or if you know code
add_filter('show_admin_bar', '__return_false');
Thanks for pointing that out. I think i should make more use of bbp_parse_args().
bbp_create_initial_content() seems to be a good idea for deploying initial content, but i needed something more flexible, which can be used in the Dashboard. E.g. for deploying a default structure, given in said JSON File to a newly created Forum.
The code isn’t better, but I wanted to be sure that code itself wasn’t an issue. obviously posting the exact code works, although it doesn’t preform what you wish.
So back to the gallery plugin author for his help
I don’t know what giving throttle capability does the dics only discuss the setting
Throttle posting every
Set this to the minimum time (in seconds) between posting new replies in bbPress forums. This is useful to help stop spamming or other attempts to interrupt the normal flow of the forum.
I copied and paste the code again, and now I don’t get the warnings. So, why is this code better :)?
Besides, what does throttle mean, in the capabilitie?
so did you copy/paste it – exactly as per my code and what exact errors did you get?
Hi @brad3n,
When there is a mention of functions.php to add code, it’s always referring to the functions.php of your (child) theme, never inside a plugin.
https://codex.bbpress.org/functions-files-and-child-themes-explained/
Pascal.
Pascal, so where exactly would I put those particular 3 codes at in the wordpress? or actually in the css section of the theme editor?
Whilst I can see some of your concerns, there are no security concerns that bbpress will let your users access your wordpress site backend – none of us would use bbpress if it had backdoors like that.
You core issue seem to stem from
I had to install some bbPress code in my functions file to stop non-administrator profiles from seeing the WordPress main menu at the top of the forum.
Please explain further? or give us the code you used.
With that, in having to add code such as this I subsequently shut down my entire site due to adding code the functions.php file that it didn’t like. Not a good situation for me.
That is a wordpress issue, and if you are not good at coding you should not be editing files ion a live site. You really need a test site
https://codex.bbpress.org/getting-started/testing-your-bbpress-installation/creating-a-test-site/
Yes you can set up a separate domain/sub-domain with wordpress and bbpress running, and just show bbpress in this site. BUT you can’t have this administered by the other wordpress site (well at least not at any level of understanding that you would have – you are not ready for multisite 🙂 )
So either you run one site or two sites. 1 site will not give you security issues if set up correctly in wordpress. 2 sites will mean lots of duplication of usernames, double updating, and more room for error.
I’d suggest you look strongly at the test site route – this will force you to learn about how a wordpress site is put together, which will allow you to do changes with confidence of more technical knowledge and no risk to live
Good luck, and do come back and let us know how you get on
Yes, I tried your other code, in an earlier post of yours. But then I get the warnings again.
All plugin writers write code to try and not interfere with each other – but occasionally we fail.
I’d suggest you post a thread on their support forum to see if they can help.
Did you try my shorter code – there is a reason for this question !
Hi!
Thank you for the reply. I just want to edit the wp_editor that displays when I click
“Topics” > “New Topic”.
I want to remove a couple of buttons of that editor, but I don’t want the change to be global, as I have a lot of other editors with specific parameters. This function works:
function my_format_TinyMCE( $in ) {
//styles for the editor to provide better visual representation.
$in['content_css'] = get_template_directory_uri() . "/build/styles/tiny-mce-editor.css";
$in['block_formats'] = "Paragraph=p; Heading 1=h1; Heading 2=h2";
$in['toolbar1'] = 'formatselect,bold,italic,underline,superscript,bullist,numlist,alignleft,aligncenter,alignright,link,unlink,spellchecker';
$in['toolbar2'] = '';
$in['toolbar3'] = '';
$in['toolbar4'] = '';
return $in;
}
add_filter( 'tiny_mce_before_init', 'my_format_TinyMCE' );
BUT! It will affect and overwrite parameters to my other editors.
The Hooks/Filters in the documentation of bbpress work, but they seem to only affect when creating a topic/forum not from the wp-admin but from the actual bbpress page.
Any ideas? Thank you!
ok, so you need to amend form-topic.php
Presumimg you can use FTP and use an editor
create a directory on your theme called ‘bbpress’
ie wp-content/themes/%your-theme-name%/bbpress
where %your-theme-name% is the name of your theme
find
wp-content/plugins/bbpress/templates/default/bbpress/form-topic.php
Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
wp-content/themes/%your-theme-name%/bbpress/form-topic.php
bbPress will now use this template instead of the original
and you can amend this
So in form-topic.php you need to amend line 28 from
<?php if ( bbp_current_user_can_access_create_topic_form() ) : ?>
to
<?php if ( bbp_current_user_can_access_create_topic_form() && (bbp_get_forum_title() == 'other' ) : ?>
This should then only allow new topics if the user can create a topic and the cforum title is ‘other’ forum
This is untested, but should work !
so did you try my code???
Hello!
I’m having some issues styling the buttons in the bbPress Topics/Forum section. My website contains a large amount of TinyMCE editors — some need specific styles and buttons. Assigning this was very easy to my custom editors, but I’m facing an issue when trying to customize the bbpress editor. None of the code I found in the forums seems to do anything to the buttons.
Here is a snipped of how I’m modifying my other editors. Since these are custom, Is easy to modify by just adding the parameters.
wp_editor(
$options['callout_body'],
'callout_body’, //ID OF EDITOR
array(
'textarea_name' => 'page_options_employer_guide_thrive_overview[callout_body]',
'media_buttons' => false,
'textarea_rows' => 8,
'tabindex' => 4,
'quicktags' => false,
'tinymce' => array(
'toolbar1'=> 'bold,italic',
'toolbar2'=> '',
'toolbar3'=> '',
),
)
);
The buttons that I need displayed in the bbpress editor are different from any other custom post type or options page editor.
I’ve tried every snippet I could find in the forums with no luck, no change. I tried to hook to the examples and add filters, with no luck as well.
I hope I’m clear enough to what I’m trying to achieve.
Thanks
Try :
function rew_add_custom_role( $bbp_roles ) {
$bbp_roles['bbp_global_moderator'] = array(
'name' => 'Globale moderator',
'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() ) // the same capabilities as moderator
);
return $bbp_roles;
}
add_filter( 'bbp_get_dynamic_roles', 'rew_add_custom_role', 1 );
It’s because you haven’t set the moderate primary cap 3rd one down in the list below.
The full default mod caps are
// Moderator
case bbp_get_moderator_role() :
$caps = array(
// Primary caps
'spectate' => true,
'participate' => true,
'moderate' => true,
'throttle' => true,
'view_trash' => true,
// Forum caps
'publish_forums' => true,
'edit_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,
);
you are missing
'moderate' => true,
from yours !