Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 1,376 through 1,400 (of 32,481 total)
  • Author
    Search Results
  • #225482
    webcreations907
    Participant

    When no-js is used, it’s usually removed using javascript or jquery to check if the browser supports it as some people turn it off in there browser preferences.

    Try adding the below code to your functions.php or code snippet plugin, etc.

    
    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' );
    }
    

    Make sure to clear any caches and check to see if it works for you.

    #225477
    artmuns
    Participant

    the error is when the β€˜nonce’ does not validate.

    https://codex.wordpress.org/WordPress_Nonces

    I suppose I could try using translation to make it a friendly message but would rather try and fix it.

    function my_nonce_message ($translation) {
        if ($translation === 'Are you sure you want to do this?') {
           return 'Please try again.';
        } 
    
        return $translation;
    }
     
    add_filter('gettext', 'my_nonce_message');
    #225476
    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 πŸ™‚

    #225472
    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.

    #225465
    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' );
    #225453
    TreeTrail
    Participant

    This topic has been resolved! We discovered what was causing this problem. It was not any custom code or plugin update issue. It was simply that I had changed the bbPress Forum > Visibility from “public” to “private”. Evidentially this prevents a plugin (like bbPress Toolkit) or custom code (like ours) from accessing the information.

    #225444

    Can you please post the code snippet you are using to enable the visual editor?

    In my testing, it is working OK using these snippets:

    Enable Visual Editor

    #225438

    This is a deprecated argument that only appears when WP_DEBUG is turned on.

    The debug log itself is nothing to worry about. πŸ‘

    bbPress will address this once its minimum version is (legitimately) raised to 5.5.

    Thank you for letting us know here πŸ™

    #225435

    Revisions are totally a WordPress thing. It’s weird, but sounds accurate.

    Using Gravity Forms to create new topics & replies will bypass the “freshness” hooks that bbPress expects to run normally. This means that the “branch” of topics & forums in the “tree” of that submission won’t get walked up to the root, to tell that whole branch what its most recent content is.

    Once you post something yourself normally, the tree gets walked and everything looks OK.

    The function that would normally be called is bbp_update_topic(). It includes all of the extra meta data that needs to be added – including a call to bbp_update_topic_walker() that “walks” the branch in the tree.

    Lastly, it refreshes the last_changed cache key in the bbpress_posts cache group. You could try busting that cache on your Gravity Forms submission (to see if that’s enough) but I have a feeling it won’t be, and you’ll need to find the best way to trigger the update.

    #225427

    The body class code changed, which might be causing this.

    It is not intended, so 2.6.8 should fix it.

    #225419
    KevinPlusPlus
    Participant

    Hi,

    Yes, the same thing happened to us. It looks like it is because of line 971 in common/templates.php

    $bbp_classes = array( ‘no-js’ );

    Remove the no-js and the editor will come back.

    I don’t see any way to do this without directly editing the source code for the plugin. Hopefully an oversight that can be corrected.

    Kevin

    #225413
    Alexander Agnarson
    Participant

    I just found out this issue too, and it breaks all of my pages. All pages now has a bbpress body class.

    I kind of need an urgent fix – any code that I can add to fix it for now?

    #225393
    conniefournier
    Participant

    It appears that the post_parent is no longer updating in the database for some reason. So, I am trying to fix that, and to run the bbp update programatically as well because that seems to fix it when I run it on replies in the admin panel. This is the code I am using, but it isn’t working.

    This is what I have so far. Does anything look wrong to you?

    add_action( 'gform_post_submission', 'set_post_content', 10, 2 );
    function set_post_content( $entry, $form ) {
     
        //getting post
        $post = get_post( $entry['post_id'] );
       
       //getting meta values
        $topicID = get_post_meta($post,'_bbp_topic_id',true);
        $forumID = get_post_meta($post,'_bbp_forum_id',true);
    
    $reply_data = array('post_parent'=>$topicID);
    $reply_meta = array('forum_id'=>$forumID, 'topic_id' => $topicID);
    
    bbp_update_reply($reply_data,$reply_meta);
    
    }
    #225390
    Robin W
    Moderator

    without a deep dive into your code and gravity, we’ll need to guess at answers.

    I presume you are not running any caching software?

    if not then you could tie a new reply to the action on submission.

    so if you have data, then the new_reply_handler in \includes\replies\functions.php starting at line 125 might be what you need.

    if you have $_POST data, then it might be as simple as

    add_action( 'whatever_your_actions_hook_is', 'bbp_new_reply_handler', 10 );

    gerryj
    Participant

    Hello,

    I am currently customizing my topic pages and noticed that in the bbp-header as well as the bbp-footer the two elements bbp-reply-author and bbp-reply-content exist.
    I can’t seem to figure out what these elements do there?
    Every reply has these two elements, but there they make sense because within these elements the different sections of the replies are located.
    Can you tell me if they actually do something in the bbp-header ad bbp-footer, if they don’t do anything I’m just gonna delete via my child theme to get rid of the unnecessary code

    #225372
    dusemedia
    Participant

    According to the documentation, the code below enables paste as plain text in the visual editor:

    function bbp_tinymce_paste_plain_text( $plugins = array() ) {
        $plugins[] = 'paste';
        return $plugins;
    }
    add_filter( 'bbp_get_tiny_mce_plugins', 'bbp_tinymce_paste_plain_text' );

    It works fine when using the full visual editor, enabled by this code:

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

    But paste as plain texts does not work when using the Teeny editor, enabled with this code:

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

    Does anyone have a snippet to enable paste as plain text when using the Teeny editor?

    #225355
    conniefournier
    Participant

    I did refer to them and they said that I should find out what metadata was needed by BBPress, and make sure that was added when the form was submitted.

    I researched the docs here and found that I needed to include _bbp_forum_id and _bbp_topic_id. So, the replies were being posted to the correct forum and topic, but they weren’t showing up on the front end of the forum. I read elsewhere in this forum that the post_parent had to be updated, so I did that using a code snippet.

    But, the problem is that I am missing something for BBPress. Gravity Forms and the extension are working properly, but something is missing in BBPress until I update the topic from the back end.

    conniefournier
    Participant

    I am using Gravity Forms and their Advanced Post Creation Add-On to submit replies to topics in my forum.

    I added a code snippet to add the post_parent to the reply using the gform after submission hook.

    I checked in the database, and that is working properly.

    The only problem is that the reply does not show up on the front end…until I update it, then it works properly.

    Is there something I am missing in this process?

    #224433
    Robin W
    Moderator

    untested but

    
    bbp_get_topic_subscription_link (array( 'object_id'  => $topic_id) ))
    #224432
    thesupplyroom
    Participant

    Hello,

    Is there a way I can edit the forums pages to include a banner BEFORE the topic? so for example, on my “latest topics” page I have an image before using shortcode [bbp-topic-index].

    So I would like that same image to carry through at the top of my forum topics on:

    http://www.mywebsite/forums/topic/topic-title

    I understand I can achieve this by changing the topic category description to the banner and then using the BBP Style Pack plugin to set “show description” but this isnt an ideal solution as it only shows on the forum category list not on the actual posts…

    Any ideas?

    #224394
    kbtwen
    Participant

    Hi,
    I want to search forum (topics and replies) by user name.

    I add input with name “bbp_search_by_user”

    <input type="text" name="bbp_search_by_user" id="bbp_search_by_user" value="" />

    in form-search.php

    but how can I get value of “bbp_search_by_user” in my custom function file since $_GET[‘bbp_search_by_user’] doesn’t show anything?

    Thanks

    #224391
    pluckvermont
    Participant

    So our site typically has minimal users, myself and a few admins. We login properly and make the edits to the site.

    We have a forum set-up coming online. Our registrants to the forum will get an email when they register. They’ll register from the bbpress shortcode I included on a page.

    Instead of saying “Welcome the forum”, the email they receive says New User Registration.
    The URL it provides is the /wp-login, not the page with the bbpress login shortcode. It’s a default WP registration and login.

    I’d liked to customize emails going to forum registrants that are specific to the forum.

    Does that make sense?

    Thx–

    #224390
    dalton125
    Participant

    I think this post belongs in the “Development” forum, but that forum has a message saying that it’s closed to new posts. Let me know if there’s a better place for my question.

    I’m trying to create a navigation sidebar for users to navigate my bbPress forum. I’ve seen WordPress themes with a navigation sidebar for blog posts which has a list of months and years, as in:

    August 2021
    September 2021
    October 2021

    And clicking any of those list items will show the user any blog posts created in the given month. This is what I’d like to emulate with bbPress β€” a sidebar with links to different months, and clicking the link will show the user all forum topics created in that month.

    Does anyone have advice on how to do this? I’ve looked through the bbPress settings and even installed the bbp style pack plugin, but I can’t find a setting that will do what I’m trying to do. Is there a plugin or setting that I’ve missed? I don’t mind writing code to solve this problem, but I’m a PHP beginner so I’m not sure where to begin.

    I’m using WordPress 5.7.2 and bbPress 2.6.6. I don’t have a live version of my site to show.

    #224366
    maksanse
    Participant

    Thank you Robin for this so quick answer πŸ™

    I already use your awesome plugin + additional shortcodes (thanks a lot).
    But it doesn’t allow me to get (and use) the information “Is there any topic to read for this user ?” so that I use it in my menu…

    By reading this post : https://bbpress.org/forums/topic/get-topics-of-subscribed-to-forums/
    I ask myself if there is a way to make a function that :

    1) get the subscribed forums html
    2) check if there is the “unread” tag in this html
    3) return YES or NO (or best : the number of “unread” occurences)

    Do you think this is feasible ?

    maksanse
    Participant

    Hello there,

    I look for a shortcode that would allow me to display to the user the number of unread topic in his subscription (or at least, if there is any unread topic there).

    I have looked for it for a long time and couldn’t find anything suiting my needs or functional.

    Does anymone have an idea or solution to this need ?

    (My aim : without using buddypress, display a “user notification bell” on my menu with an indication to the user when unread topics are available… Pretty classic use case, but not so easy to find πŸ˜… )

    Thank you for your help or clues πŸ™

Viewing 25 results - 1,376 through 1,400 (of 32,481 total)
Skip to toolbar