Embedding discussions into a custom tab

Top WooCommerce & WordPress Plugins Forums Discussions Tab for WooCommerce Products Embedding discussions into a custom tab

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #92581
    ericdjuly.com
    Participant

    How would I go about embedding discussions into a custom tab created by another plugin?

    Here is the code for the tab. I effectively would like to echo out discussions in the discussions tab.

    add_filter('wpcf_default_single_campaign_tabs', 'single_tab_callback_stretch', 100);
    function single_tab_callback_stretch( $tabs = array() ) {
        $tabs['stretch'] = array(
            'title' => __( 'Stretch Goals', 'text_domain' ),
            'callback' => 'tab_content_callback_stretch'
        );
        $tabs['discussion'] = array(
            'title' => __( 'Discussion', 'text_domain' ),
            'callback' => 'tab_content_callback_discussion'
        );
        return $tabs;
    }
    function tab_content_callback_stretch(){
        echo '<h3>Stretch Goals</h3>';
        echo do_shortcode('[elementor-template id="322"]');
        //echo '<h3>After Shortcode</h3>';
    }
    function tab_content_callback_discussion(){
        echo '<h3>Discussion</h3>';
        echo THIS_IS_WHERE_TO_PUT_DISCUSSIONS----();
    }

    Thanks for your help!

    • This topic was modified 10 months, 3 weeks ago by Omar Dabbas.
    #92582
    Pablo Pacheco
    Participant

    Hi,

    You could probably try to add this:

    if ( class_exists( 'Alg_WC_Products_Discussions_Tab' ) ) {
    	echo alg_wc_products_discussions_tab()->core->get_comments_template();
    }

    I must say the plugin was not designed to work like that. I’m not sure if it will work 100% this way. But of course you can try 🙂

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