Search Results for 'code'
-
AuthorSearch Results
-
November 30, 2021 at 2:26 pm #225899
In reply to: HTML editor doesn’t appear on bbpress 2.6.7
Robin W
ModeratorI appreciate your frustration, but not sure ‘fault’ is the correct word.
bbpress has changed something – but the ‘fix’ when it comes may not ‘fix’ you, as your site is adding a no-js class (from either the ‘Publisher’ theme or a plugin) which then isn’t overwritten as is normal practice by a test within your theme or the plugin.
you could try adding this to the custom css of your theme
.no-js { display : inline !important }to override the bbpress setting
November 30, 2021 at 1:59 pm #225897In reply to: Hide “New Topic” Form on Certain Pages
Robin W
ModeratorUntested, but find
wp-content/plugins/bbpress/templates/default/bbpress/form-topic.phptransfer this to your pc and edit
change line 31
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_id() != '2927') ) : ?>and save
where 2927 is the forum you don’t want to show the form for
then create a directory on your theme called ‘bbpress’
ie wp-content/themes/%your-theme-name%/bbpresswhere %your-theme-name% is the name of your theme
Then transfer the file you saved above 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.phpbbPress will now use this template instead of the original
If you want multiple forums, you could create and array and test against that
November 30, 2021 at 1:40 pm #225894In reply to: Hide “New Topic” Form on Certain Pages
Robin W
Moderatorso do you want to hide the new topic form every time this particular forum displays (easier), or just for this particular shortcode on a page (more difficult) ?
November 30, 2021 at 7:35 am #225886Topic: 2.6.9, what is in it?
in forum InstallationEditor Mike
ParticipantMy dashboard takes me here when I click for latest updates.
But that is not up to date, how do we know what is in an update before we install it?
November 29, 2021 at 6:30 pm #225871Topic: Hide “New Topic” Form on Certain Pages
in forum Troubleshootingbradm413
ParticipantbbPress Version 2.6.9
WP version 5.8.2
site: https://branchtheworld.comI have searched and haven’t found an exact case like what I’m looking for. I would like to hide the “New Topic” form that displays when using this shortcode:
[bbp-single-forum id=$forum_id] – Display a single forums topics. eg. [bbp-single-forum id=32]See screenshot here:

Is this something I’ll need to do with custom coding, or is there a plugin or another simple way to achieve this?
November 29, 2021 at 5:55 am #225855In reply to: HTML editor doesn’t appear on bbpress 2.6.7
Robin W
Moderatoryour theme/developer has added the ‘no-js’ class to the very top, hence why the other codes are not working.
can you try this snippet
add_action( 'wp_footer', 'rew_supports_js' ); function rew_supports_js() { echo '<script>document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + " js ";</script>'; }Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
November 27, 2021 at 12:31 pm #225835In reply to: Forum Width
Robin W
ModeratorThe width is governed by a div with the class rt-container, but it is not clear what craetes that.
Try this in the custom css part of your theme
.rt-container { width: 1500px !important; }November 27, 2021 at 8:32 am #225824In reply to: Paste as plain text for the Teeny Editor?
dusemedia
ParticipantThat plugin works fine for the WP Classic Editor but not for the BBPress Teeny editor.
The paste as plain text code in the documentation above works fine for the regular BBPress TinyMCE editor but not for the BBPress Teeny editor.
November 26, 2021 at 9:08 am #225804In reply to: Best way to extend member profiles?
Robin W
Moderatorbuddypress has profile fields –
November 25, 2021 at 8:25 am #225795In reply to: Can I get the latest reply ID by topic ID?
Robin W
Moderatorbbp_get_topic_last_reply_id( $topic_id)November 25, 2021 at 4:47 am #225780In reply to: HTML editor doesn’t appear on bbpress 2.6.7
Robin W
ModeratorThere is a temporary fix, either
1. use code
if( !function_exists( 'bbpress_browser_supports_js' ) ){ function bbpress_browser_supports_js() { echo '<script>document.body.classList.remove("no-js");</script>'; } add_action( 'wp_footer', 'bbpress_browser_supports_js' ); }Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
or
2. install and activate
November 24, 2021 at 10:56 am #225767pannenkoek
ParticipantOh wait wrong code and not able to edit original post… here is the good one
jQuery("form.bbp-login-form").find(".bbp-submit-wrapper").append( '<button class="button" onclick="location.href=\'http://LINK-TO-REGISTER-PAGE\'" type="button">Registreer</button>' );November 24, 2021 at 10:38 am #225764pannenkoek
ParticipantAnd then I stumbled on to the same problem. I came up with the following solution.
Create a page and add the shortcode [bbp-register] to display the register screen.
Then add the following code to your functions.php
function add_bbp_register_button() { ?> <script type="text/javascript"> jQuery('.bbp-submit-wrapper').append( '<button onclick="location.href=\'http://LINK-TO-REGISTER-PAGE\'" type="button">Register</button>' ); </script> <?php } add_action('wp_footer', 'add_bbp_register_button');cheers
November 24, 2021 at 9:19 am #225759In reply to: forum appears in google search
Robin W
ModeratorNovember 23, 2021 at 2:30 pm #225728In reply to: Editor buttons missing since 2.6.8 upgrade
Robin W
Moderatorthis is a temporary fix, the bbpress authors are looking at a permanent one
if( !function_exists( 'bbpress_browser_supports_js' ) ){ function bbpress_browser_supports_js() { echo '<script>document.body.classList.remove("no-js");</script>'; } add_action( 'wp_footer', 'bbpress_browser_supports_js' ); }Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
November 23, 2021 at 1:51 pm #225727In reply to: HTML editor doesn’t appear on bbpress 2.6.7
Robin W
Moderatoras far as I understand, the issue is detailed in changeset 7190 – yes?
so it is basically to hide the ‘generate passwword’ in form-user-passwords.php if the user’s browser does not support js or it is disabled.
If so, at the moment all bbpress pages end up with a no-js class as bbpress sets ‘no-js’ as the default, which means that the quicktags do not display on the topic and reply forms as they need js but the css thinks it is no-js, and the visual editor does not work for the same reasons.
At the moment you only test for js using the script technique in form-user-passwords.php viz
<script type="text/javascript"> document.body.className = document.body.className.replace( 'no-js', 'js' ); </script>so I would suggest 1 of 2 approaches
1. putting this test in more generally so it runs on any bbpress page (as usefully suggested by @webcreations907) maybe by adding to the main function, or adding a filter in \includes\core\filters.php to run the script
so something like :
add_filter ('bbp_body_class' , bbp_test_js) ; function bbp_test_js ($classes) { ?> <script type="text/javascript"> document.body.className = document.body.className.replace( 'no-js', 'js' ); </script> <?php return $classes ; }so that others could disable it
2. changing the class to bbp-no-js should work, if you do this in the bbp_body_class function and the form-user-passwords.php and in css, then I can no reason why it would not work if that is the sole intention of this.
November 23, 2021 at 12:55 pm #225721In reply to: HTML editor doesn’t appear on bbpress 2.6.7
John James Jacoby
Keymaster@robin-w – any suggestions on improvements bbPress should make?
I was thinking of renaming
no-jstobbp-no-jsto try and avoid an issue with other plugins or themes already doing something with that class, but I’m not sure that solves this specific problem.November 23, 2021 at 12:48 pm #225719In reply to: Topic or forum (un)subscription hook
John James Jacoby
KeymasterThere is also…
do_action( 'bbp_add_user_subscription', $user_id, $object_id, $type );…and…
do_action( 'bbp_remove_user_subscription', $user_id, $object_id, $type );…if you need something a bit more lower-level, that isn’t tied directly to the request handler.
November 22, 2021 at 4:55 pm #225538In reply to: HTML editor doesn’t appear on bbpress 2.6.7
Robin W
Moderator@mr18 – then suggestion is to either use this in a child theme functions file, which will not lose settings on a main theme update, or use code snippets, which does not change on a theme update.
November 22, 2021 at 4:17 pm #225537In reply to: HTML editor doesn’t appear on bbpress 2.6.7
lisabeavers
ParticipantI used code snippits and the first chunk of code you gave me and it appears to have worked! Thank you!
November 22, 2021 at 3:29 pm #225533In reply to: HTML editor doesn’t appear on bbpress 2.6.7
webcreations907
Participant@robin-w if you remove the
no-jsin php, then it doesn’t allow the reason for adding it which would be to test if the browser supports javascript/jquery.Just an example
Say you have a slider(JS dependent) that you only want to show if the browser supports js, then adding.no-js .my-slider{display:none;}would hide the slider if the browser didn’t support it, while if the browser supports JS then theno-jswould be removed by JS and the slider would be displayed. Because the only way the class was removed was with JS which would verify the browser supports JS.So if you remove it with PHP then there is no test and the slider is shown regardless if the browser supports JS or not. Not sure what the percentage of browser users that have it disabled, sure it’s a very very small amount.
You can see that in theme TwentyTwentyOne in
template-functions.phpthe theme does it the same way I mentioned above in earlier post.Just wanted to mention it, hopefully it gets updated shortly and a fix gets out for it.
November 22, 2021 at 2:28 pm #225532In reply to: HTML editor doesn’t appear on bbpress 2.6.7
Robin W
Moderator2.6.8 does not fix.
so use either
add_filter ('bbp_body_class', 'rew_unset_no_js') ; function rew_unset_no_js($classes) { if (in_array ('single-forum', $classes) || in_array ('single-topic', $classes)) { if (($key = array_search('no-js', $classes)) !== false) { unset($classes[$key]); } } return $classes ; }or if that doesn’t work
add_filter ('bbp_body_class', 'rew_unset_no_js') ; function rew_unset_no_js($classes) { if (($key = array_search('no-js', $classes)) !== false) { unset($classes[$key]); } return $classes ; }Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
November 22, 2021 at 1:37 pm #225530In reply to: Topic or forum (un)subscription hook
Robin W
Moderatoras far as I know this action is fired on ANY subscribe/unsubscribe
// Do additional subscriptions actions do_action( 'bbp_subscriptions_handler', $success, $user_id, $object_id, $action, $object_type );November 21, 2021 at 11:44 pm #225484In reply to: HTML editor doesn’t appear on bbpress 2.6.7
webcreations907
ParticipantThat’s good, glad that worked out for you.
You could also put it in
bbpress.phpin the plugin itself, then when the fix comes out and the plugin is updated it would get rid of it.For others looking for a solution, I tried to edit my post above but couldn’t, when I mentioned
functions.phpI mean thefunctions.phpfile that is within your current active WordPress theme.November 21, 2021 at 11:36 pm #225483In reply to: HTML editor doesn’t appear on bbpress 2.6.7
KevinPlusPlus
ParticipantWebcreations907,
This code snippet added to my functions.php does then show the Text / Visual tabs and allow switching between them.
Not sure if that’s the permanent solution, but that does get things working without modifying the plugin code itself.
Kevin
-
AuthorSearch Results