Robin W (@robin-w)

Forum Replies Created

Viewing 25 replies - 3,051 through 3,075 (of 14,231 total)
  • @robin-w

    Moderator

    🙂

    @robin-w

    Moderator

    bbp_get_topic_last_reply_id( $topic_id)

    @robin-w

    Moderator

    put this in your themes custom css part

    .bbp-topic-started-by {
    display :none ;
    }

    @robin-w

    Moderator

    @oscowordpress1

    There 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

    Code Snippets

    or

    2. install and activate

    bbp style pack

    @robin-w

    Moderator

    I’m just trying stuff !! 🙂

    Intermittent problems are always hard to fix

    @robin-w

    Moderator

    @robin-w

    Moderator

    I don’t think it will make a difference, but try

    dashboard>settings>permalinks and just click save – that just resets them

    @robin-w

    Moderator

    this 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

    Code Snippets

    @robin-w

    Moderator

    @johnjamesjacoby

    as 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.

    @robin-w

    Moderator

    🙂

    @robin-w

    Moderator

    ok, so when this happens

    – is it to just one person, the same person, different people, all people accessing the site
    – is the site unusable, does it freeze, or is it just if they try to do something ?

    @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.

    @robin-w

    Moderator

    very happy for you to mention it 🙂

    Adding the no-js class to the bbpress body is something that bbpress 2.6.8 introduced. This was I am presuming on the presumption that that js was never needed on bbpress pages which is not the case in you want the visual editor or quicktags on the text editor.

    I’m simply taking it out for bbpress pages as a first step for those that need it, ie remving the change in 2.6.8 and reverting to the absence that bbpress has used for 7 years. My presumption is that the visual editor will not work on browsers that do not support js, which as you say is a very small amount if any actually used nowadays !!

    anyway thanks for your clarification, let’s see what the bbpress authors do.

    @robin-w

    Moderator

    2.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

    Code Snippets

    @robin-w

    Moderator

    as 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 );

    @robin-w

    Moderator

    the snippet I used takes it out before bbpress renders, @webcreations907 snippet does it after. Neither is right/wrong, and use whichever is better for you

    @robin-w

    Moderator

    which fix, style pack or the snippet above?

    @robin-w

    Moderator

    It’s not an error I’ve seen often.

    usually it would relate to url’s being wrong, but this would then apply to all your attempts.

    @robin-w

    Moderator

    the error is when the ‘nonce’ does not validate.

    https://codex.wordpress.org/WordPress_Nonces

    not sure what you can do about it, not my speciality 🙂

    @robin-w

    Moderator

    bbp-style-pack has a temporary fix in new version

    @robin-w

    Moderator

    @jjj Moving the ‘no-js’ class to the bottom of the ‘bbp_body_class’ function does not fix, as the quicktags toolbar is still not shown.

    the following filter fixes, but I’m not entirely sure what the introduction of then ‘no-js’ class to the function is doing, but I can’t see that the patch has any unintended consequences as it only runs on the relevant pages.

    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

    Code Snippets

    FOR THOSE USING BBP-STYLE-PACK – I’ll issue a revised version incorporating this shortly until fixed in bbpress.

    @robin-w

    Moderator

    no quicktags are shown in 2.6.8, which is I think where the problem lies

    @robin-w

    Moderator

    ok, in my testing

    working :

    function bbp_enable_visual_editor( $args = array() ) {
        $args['tinymce'] = true;
        $args['quicktags'] = false;
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );

    not working

    function bbp_enable_visual_editor( $args = array() ) {
        $args['tinymce'] = true;
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );

    @robin-w

    Moderator

    🙂

    @robin-w

    Moderator

    🙂

Viewing 25 replies - 3,051 through 3,075 (of 14,231 total)