• Resolved qnkov

    (@qnkov)


    Hello. I’ve added another tab to my Profile which i wanted once clicked, to show the content of certain shortcode, but looks like it does not want to make the shortcode to work. I see the text of the shortcode once i click on that tab. Here is the code:

    function um_mycustomtab_add_tab( $tabs ) {
        $tabs['mycustomtab'] = array(
            'name' => 'История на гледане',
            'icon' => 'um-faicon-film',
            'custom' => true
        );
    
        UM()->options()->options['profile_tab_' . 'mycustomtab'] = true;
    
        return $tabs;
    }
    add_filter('um_profile_tabs', 'um_mycustomtab_add_tab', 1000);
    
    function um_profile_content_mycustomtab_default( $args ) {
        // Поставете вашия shortcode тук. Пример:
        echo do_shortcode("[ts-history-page perpage='10' style='2']");
    }
    add_action('um_profile_content_mycustomtab_default', 'um_profile_content_mycustomtab_default');

    How can i make this shortcode: [ts-history-page perpage=’10’ style=’2′] , to work and i can see the content of it? It works fine in pages.

Viewing 4 replies - 1 through 4 (of 4 total)
  • @qnkov

    I see the text of the shortcode once i click on that tab

    Your shortcode snippet is not found so WP has no PHP code to execute.

    Thread Starter qnkov

    (@qnkov)

    @missveronicatv

    It does work if it’s on page. I can view the content of it. So how to fix that?

    @qnkov

    Install the shortcode snippet as you have done with the above code snippet.

    I made a test of your shortcode by adding this to your code and it’s working very well.

    add_shortcode( 'ts-history-page', 'ts_history_page_shortcode');
    function ts_history_page_shortcode( $atts, $content ) {
    
        return 'Test perpage = ' . $atts['perpage'] . ' and style = ' . $atts['style'];
    }
    • This reply was modified 11 months, 3 weeks ago by missveronica.
    Plugin Support andrewshu

    (@andrewshu)

    Hi @qnkov

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread if any other questions come up and we’d be happy to help. ??

    Regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Shortcode to custom tab?’ is closed to new replies.