• Hi, I want do add a new tab with content in the Tutor LMS, but now a link, but a tab with a shortcode
    Ive created a shortcode do show all users downloads from woocommerce

    /*create a shorcode do show the /my-accounts/downloads/ content*/
    function my_account_downloads_shortcode() {
        if ( is_user_logged_in() ) {
            ob_start();
            wc_get_template( 'myaccount/downloads/' );
            return ob_get_clean();
        } 
    }
    add_shortcode( 'my_account_downloads', 'my_account_downloads_shortcode' );

    I’ve create a new tab in the tutor dashboard

    /*remove the tabs i dont want*/
    add_filter('tutor_dashboard/nav_items', 'remove_some_links_dashboard');
    function remove_some_links_dashboard($links){
    	unset($links['reviews']);  
    	unset($links['wishlist']);
    	unset($links['my-quiz-attempts']);  
    	unset($links['question-answer']);
    	return $links;
    }
    
    /*add a tab i want*/
    add_filter('tutor_dashboard/nav_items', 'add_some_links_dashboard');
    function add_some_links_dashboard($links){
    
    	$links['custom_link'] = [
    		"title" =>	__('Meus Downloads', 'tutor'),
    		"url" => "/painel/downloads/",
    		"icon" => "tutor-icon-download-bold",
    
    	];
    	return $links;
    }

    and create a file called downloads.php on the folder tutor/templates/dashboard/downloads/downloads.php with this code

    <?php
    /*
    Template Name: My Account Downloads
    */
    get_header();
    ?>
    <div id="tutor-dashboard-content">
        <?php echo do_shortcode('[my_account_downloads]'); ?>
    </div>
    <?php
    get_footer();

    but i get a 404 page, i dont know what to do.

    Im creating a online course website, with the woocommerce checkout, because its based on Brazil and i need specific payment method, but will sell PDF files as well, but i dont want the user to have two dashboard, one for the course and one for the download, it isnt pratical, and ive tried to put the courses inside the woocommerce painel, but it dont keep the laout, but i prefer use the tutor painel, since course is the main product. thanks

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘New tab on Tutor Dashboard’ is closed to new replies.