Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 1,326 through 1,350 (of 32,432 total)
  • Author
    Search Results
  • #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 🙏

    #224361
    mbfit
    Participant

    I thought that I got it here, on a page that had various code to add to your WP site. If I could find it again I’d likely be able to resolve it…

    Robin W
    Moderator
    .bbp-topics ul.sticky,
    .bbp-forum-content ul.sticky
    {
    background-color: blue !important;
    }
    #224320
    mbfit
    Participant

    Can’t remember where I found this code, tried a search, but it use to show 4 topics underneath the Forum headers but no longer shows anymore. Was this affected on an update or perhaps if someone can direct me to the page that had these codes? Thanks.

    /*
    * Show 4 topics for Forum Groups
    */
    ul.bbp-forums-list li:nth-child(n+5) {
    display: none !important;
    }

    #224268
    Ludovic S. Clain
    Participant

    Hi Robin,
    thank you for your reply.

    For your reference, wp-cli commands often (if not all) have default outputs and they do not need to be explicitly declared unless particular outputs are expected.

    Here is a list of all post types available on my WordPress installation:

    https://markuphero.com/share/5dn5FOkMzGNpG9R6Unbx

    As you can see, I have a custom post type named ‘sfwd-lessons’ so if I run the command wp post list --post_type=sfwd-lessons I have all these custom posts which are listed with the default outputs:

    https://markuphero.com/share/8Mbqbgujeaou2QH60l1k

    But when i’m trying wp post list --post_type=topic the output is empty:

    https://markuphero.com/share/3APucSjLM0IHRgLHIuVb

    https://markuphero.com/share/V3pihOOXPNQWUx3Knzqd

    Have you really tried it on your end?

    Warm regards,
    Ludovic

    #224254
    Ludovic S. Clain
    Participant

    Hi there,
    if I run a command like wp post-type list I have ‘forum’, ‘topic’ and ‘reply’ which are listed but when I run wp post list --post_type=topic the table remains empty , is this normal?
    Thanks for your help!
    Ludovic

    #224159
    Robin W
    Moderator

    spectators should not be able to create topics.
    Participants by default can.

    you will either need to

    change participant permissions -see this

    Custom Capabilities

    or add

    Private groups

    and set up topic permissions which will then let you set up a group with permission to reply only

    #224148
    Robin W
    Moderator

    you can make a topic ‘super sticky’ which will make it appear at the top of all forums.

    I know of nothing that will do a couple of forums, and indeed the code to do so would need to catch lots of areas, such as subscriptions, freshness etc. which at the moment rely on the ‘post parent’ table element of WordPress, so lots of code might be needed to get it to work.

    #224126
    Robin W
    Moderator
    add_filter( 'bbp_get_forum_freshness_link', 'rew_show_forum_freshness' , 10 , 6) ;
    
    function rew_show_forum_freshness ($anchor, $forum_id, $time_since, $link_url, $title, $active_id ){
    	return $time_since ;
    }
    
    add_filter( 'bbp_get_topic_freshness_link', 'rew_show_topic_freshness' , 10 , 6) ;
    
    function rew_show_topic_freshness ($anchor, $topic_id, $time_since, $link_url, $title){
    	return $time_since ;
    }

    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

Viewing 25 results - 1,326 through 1,350 (of 32,432 total)
Skip to toolbar