• So I love what you have done with this plugin.
    I just purchased the pro version.
    Is it possible to run multiple course IDs to get a calculation?
    for example:

    echo do_shortcode('[easydash_filtered type="box" id="17510, 17639"]');

    This seem as it is possible to do with the default [easydash] shortcode to add a parameter ids="Array(course_ids)"… And just add the param to the get_posts or WP_query of Post__in = $ids.

    Is this possible?

    Reason why this is important. I want Editors role (Instructors) to beable to see reports on just the courses their have posted.

    • This topic was modified 2 years, 6 months ago by samjco.
    • This topic was modified 2 years, 6 months ago by samjco.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter samjco

    (@samjco)

    You know Post__in might not be the best reference…but:
    'author__in' => array(1,2,3) // or 'current' for current user

    So I was thinking as a quick and dirty solution you can add a new "author_ids" atts to the includes\shortcode.php (PRO) which is for global, not filtered, where a user can enter a string of ids of authors OR just ‘current’. Then make that variable GLOBAL like:

       global $tred_author_data_ids;
       $tred_author_data_ids = $edfl_widget_atts['author_ids'];

    Next go into includes\functions.php (FREE version) and add:

    // get the value of the global atts
    global $tred_author_data_ids;
    
    if($tred_author_data_ids):
    
    if($tred_author_data_ids == 'current'):
      $author_ids = get_current_user_id();
    else:
      $author_ids = $tred_author_data_ids;
    endif;
    
    //Add this to ALL args in functions.php
    $args['author__in']  =  array($author_ids);
    
    endif;
    
    • This reply was modified 2 years, 6 months ago by samjco.
    • This reply was modified 2 years, 6 months ago by samjco.
    • This reply was modified 2 years, 6 months ago by samjco.
    • This reply was modified 2 years, 6 months ago by samjco.
    • This reply was modified 2 years, 6 months ago by samjco.
    • This reply was modified 2 years, 6 months ago by samjco.
    Plugin Author Luis Rock

    (@maurolopes)

    I love that you are helping me with some code….hahahaha

    Let me understand: do you want to have stats added up for some courses?

    Thread Starter samjco

    (@samjco)

    Yes, ??

    Based on the authors of the courses.

    Plugin Author Luis Rock

    (@maurolopes)

    Next version will be about groups. Maybe that can help you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Calculation of multiple courses’ is closed to new replies.