WordPress.org

Ready to get started?Download WordPress

Forums

Cleverness To-Do List
[resolved] How to check if user has toDos? (5 posts)

  1. holgerhubbs
    Member
    Posted 1 year ago #

    Thank you for this great plugin.
    Is there a php function I could use to check if the user has any unfinished to do items?

    http://wordpress.org/extend/plugins/cleverness-to-do-list/

  2. Cindy
    Member
    Plugin Author

    Posted 1 year ago #

    No, sorry, there's no function like that in the plugin.

  3. holgerhubbs
    Member
    Posted 1 year ago #

    Thank you for your reply.
    Could you guide me to a strategic place in your code where I could for example set a global variable or add a function: $CTL_current_user_has_todos

  4. Cindy
    Member
    Plugin Author

    Posted 1 year ago #

    In my code I use CTDL_Lib::get_todos( $user, $limit, $status, $cat_id, $to_exclude ) to get a list. You can see the function in /cleverness-to-do-list/includes/cleverness-to-do-list-library.class.php on line #39.

    This may work outside the plugin, if it's executed after the plugin is loaded. It's just a WP_Query call, so you will need to loop through the results to display them.

    All items are stored in a custom post type called todo and all info is in meta values so you could also create your own WP_Query to get the info you need.

  5. holgerhubbs
    Member
    Posted 1 year ago #

    The cleanest solutions seems to be the WP_Query for "todo"
    Great... Thank you ;-)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags