Hi there, we used this function to create the my_tasks placeholder. You can create your own by following our initial logic. make sure to rename functions names and add it to your child theme/functions.php
COPY CODE
add_filter('walker_nav_menu_start_el', 'kleo_ctdl_replace_placeholders');
function kleo_ctdl_replace_placeholders( $output ) {
if ( strpos( $output, '##my_tasks##' ) !== false ) {
if ( ! is_user_logged_in() ) {
return '';
}
$count = CTDL_Lib::get_todos( get_current_user_id(), 5000, 0)->post_count;
$output = str_replace('##my_tasks##', "<b class='bubble'>" . $count . "</b>", $output);
}
return $output;
}
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution