• Post Comments as bbPress Topics + ACF(Advanced Custom Fields)

    setting > discussion > bbPress Topics for Posts Defaults

    Will it be possible in the future to set up a forum that is linked to a custom post type created with ACF? If this were possible, there would be no need to set up a linked forum for each page, which would be convenient. Bulk configuration of dedicated forums for ACF custom post types

    View post on imgur.com

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Robin W

    (@robin-w)

    I took over this plugin as it was abandoned, and I did enough to get it working again. So support is limited.

    This code will I hope add a custom post type

    // add custom post_type to bbpress topics for posts plugin 

    global $bbppt_post_type ;
    global $bbppt_post_type_name ;
    $bbppt_post_type = 'event' ;
    $bbppt_post_type_name = 'Events';

    //add to eligible post types
    add_filter( 'bbppt_eligible_post_types', 'bbppt_add_post_types');

    function bbppt_add_post_types ($content) {
    global $bbppt_post_type ;
    array_push($content, $bbppt_post_type);
    return $content;
    }

    //add to exclude options
    add_filter( 'bbppt_ex_options', 'bbppt_add_ex_options');

    function bbppt_add_ex_options ($ex_options) {
    global $bbppt_post_type ;
    $ex_options['post_type_'.$bbppt_post_type] = false ;
    return $ex_options;
    }

    //add to default options
    add_filter( 'bbppt_ex_options_default', 'bbppt_add_default_options');

    function bbppt_add_default_options ($ex_options) {
    global $bbppt_post_type ;
    $ex_options['post_type_'.$bbppt_post_type] = 'on' ;
    return $ex_options;
    }

    //add to discussion_defaults
    add_action ('bbppt_discussion_defaults' , 'bbppt_add_discussion_defaults', 10 , 2 ) ;

    function bbppt_add_discussion_defaults ($ex_options, $forum_select_string) {
    global $bbppt_post_type ;
    global $bbppt_post_type_name ;
    ?>
    <input type="checkbox" name="bbpress_discussion_defaults[post_type_<?php echo $bbppt_post_type ?>]" id="bbpress_discussion_defaults_post_type_<?php echo $bbppt_post_type ?>" <?php checked($ex_options['post_type_event'],'on') ?>>

    <label for="bbpress_discussion_defaults_post_type_<?php echo $bbppt_post_type ?>"><?php printf(__('Do this for new '.$bbppt_post_type_name,'bbpress-post-topics'), '</label>', $forum_select_string); ?>

    <br />
    <?php
    }

    add_action ('bbppt_discussion_apply' , 'bbppt_add_discussion_apply', 10 , 2 ) ;

    function bbppt_add_discussion_apply ($apply, $ex_options) {
    global $bbppt_post_type ;
    global $bbppt_post_type_name ;
    if ($ex_options['post_type_post']== 'on' || $ex_options['post_type_page']== 'on') $apply.=' and ' ;
    if ($ex_options['post_type_'.$bbppt_post_type]== 'on') $apply.=' '.$bbppt_post_type_name ;
    return $apply ;
    }

    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
    https://en-gb.www.ads-software.com/plugins/code-snippets/

    Thread Starter kampot888

    (@kampot888)

    We apologize for the delay in getting back to you! Thank you very much for the wonderful code! This plugin is a very important feature, so please help!

    I’ll try it out soon, but there’s one more thing I want to do. Is there a way to integrate woocommerce reviews with BBPRESS?

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.