Hi, more or less. I′m using this and it seems to work:
if(is_user_logged_in()) {
$user = wp_get_current_user();
if (($user) && (!in_array( “administrator”, (array) $user->roles )) && (!in_array( “editor”, (array) $user->roles ))) {
$search_criteria[“field_filters”][] = array(“key” => “status”, “value” => “active”);
$search_criteria[“field_filters”][] = array(“key” => “created_by”, “value” => $current_user_id);
}
if (in_array( “administrator”, (array) $user->roles )) {
$search_criteria[“field_filters”][] = array(“key” => “status”, “value” => “active”);
}
if (in_array( “editor”, (array) $user->roles )) {
$search_criteria[“field_filters”][] = array(“key” => “status”, “value” => “active”);
}
$entries = GFAPI::get_entries($form_id, $search_criteria, $sorting, $paging);
}
By the way, perhaps you can help me this other issue. I want to show featured image on list but I don′t know where to place this code and how. Any ideas?
jQuery(document).ready(function($) {
cell = $(‘.stickylist-fileupload a’);
cell.each(function(index) {
image = $(this).attr(‘href’);
$(this).html(‘‘);
});
});
[Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]
Thanks again, mate.
-
This reply was modified 7 years, 8 months ago by bdbrown.