Advertisement
rdusnr

Untitled

Sep 12th, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1.  
  2. if( !function_exists( 'kleo_menu_tasks' ) ) {
  3. function kleo_menu_tasks()
  4. {
  5. $count = CTDL_Lib::get_todos(get_current_user_id(), 5000, 0)->post_count;
  6. ob_start();
  7. ?>
  8. <a href="<?php echo get_home_url() . '/my-tasks/'; ?>">
  9. <i class="icon-tasks-line"></i>
  10. <?php if ($count > 0) : ?>
  11. <b class="bubble"><?php echo esc_html($count); ?></b>
  12. <?php endif; ?>
  13. <span><?php esc_html_e('Tasks', 'buddyapp'); ?></span>
  14. </a>
  15. <em class="menu-arrow"></em>
  16. <ul class="submenu">
  17. <li>
  18. <?php
  19. if ($count == 0) {
  20. echo '<span>';
  21. }
  22. echo do_shortcode('[todolist]');
  23. if ($count = 0) {
  24. echo '</span>';
  25. }
  26. ?>
  27. </li>
  28. <?php if ($count > 0) :
  29. $page_link = "#";
  30. if ($page = get_page_by_title('My Tasks')) {
  31. $page_link = get_permalink($page->ID);
  32. }
  33. ?>
  34. <li class="footer-item">
  35. <a class="btn btn-link" href="<?php echo esc_url($page_link); ?>">
  36. <?php esc_html_e("View all", "buddyapp"); ?>
  37. </a>
  38. </li>
  39. <?php endif; ?>
  40. </ul>
  41. <?php
  42. get_permalink();
  43. return ob_get_clean();
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement