this is the code i’ve puted in the function.php
/*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;
}
/*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' );
this is the code i’ve puted in the tutor/templates/dashboard/downloads/downloads.php
<?php
/*
Template Name: My Account Downloads
*/
get_header();
?>
<div id="tutor-dashboard-content">
<?php echo do_shortcode('[my_account_downloads]'); ?>
</div>
<?php
get_footer();
can anyone now whats wrong?
ps.: i’ve tried add the file downloads.php in the in the tutor/templates/dashboard/ folder, but same error
-
This reply was modified 1 year, 9 months ago by
gspsites.
-
This reply was modified 1 year, 9 months ago by
gspsites.