Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if( !function_exists( 'kleo_menu_tasks' ) ) {
- function kleo_menu_tasks()
- {
- $count = CTDL_Lib::get_todos(get_current_user_id(), 5000, 0)->post_count;
- ob_start();
- ?>
- <a href="<?php echo get_home_url() . '/my-tasks/'; ?>">
- <i class="icon-tasks-line"></i>
- <?php if ($count > 0) : ?>
- <b class="bubble"><?php echo esc_html($count); ?></b>
- <?php endif; ?>
- <span><?php esc_html_e('Tasks', 'buddyapp'); ?></span>
- </a>
- <em class="menu-arrow"></em>
- <ul class="submenu">
- <li>
- <?php
- if ($count == 0) {
- echo '<span>';
- }
- echo do_shortcode('[todolist]');
- if ($count = 0) {
- echo '</span>';
- }
- ?>
- </li>
- <?php if ($count > 0) :
- $page_link = "#";
- if ($page = get_page_by_title('My Tasks')) {
- $page_link = get_permalink($page->ID);
- }
- ?>
- <li class="footer-item">
- <a class="btn btn-link" href="<?php echo esc_url($page_link); ?>">
- <?php esc_html_e("View all", "buddyapp"); ?>
- </a>
- </li>
- <?php endif; ?>
- </ul>
- <?php
- get_permalink();
- return ob_get_clean();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement