• Resolved tbare

    (@tbare)


    Any way to pass a list of user ids to to display? (ie, [stickylist id=”1″ user=”1,3,5″] to show user 1, 3, and 5’s submissions in one list?

    I have a scenario where there’s 2 levels of users – we’ll call them Manager and Employee — Each employee will have a Manager ID in a custom meta field to pull from. Managers need to be able to see their submissions, as well as the submissions of their employees.

    I can create the plugin to generate the list, but I was hoping to have all of the submissions in the same list for the manager (that is, show Mgr ID and EmpID’s submissions in one list)

    The alternative for now will be to loop through and have a list for each employee under the manager’s list, but you can see where this may become cumbersome.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author fried_eggz

    (@fried_eggz)

    Unfortunatly not. This is due to how the Gravity Forms API works. It is not possible query for entries made by multiple users.

    However, you could just get all entries and then use a filter to remove the ones that do not match, something like this:

    add_filter('filter_entries','hide_some_rows' );
    function hide_some_rows($entries) {
    
        // Only show entries created by these user id's
        $show_only = array('1', '3', '5');
        
        foreach ($entries as $entryKey => $entryValue) {
            if (!in_array($entryValue["created_by"], $show_only)) {
                unset($entries[$entryKey]);
            }
        }
        return $entries;
    }
    • This reply was modified 6 years, 2 months ago by fried_eggz.
    Thread Starter tbare

    (@tbare)

    Thanks – I was looking at the API, too, and that’s how i was reading it. appreciate the help.

    Plugin Author fried_eggz

    (@fried_eggz)

    Did you solve this?

    Thread Starter tbare

    (@tbare)

    Project got put on the back burner, but you did answer the question – marking as resolved.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Show specific users’ lists in one list?’ is closed to new replies.