hidden link
Refer to screenshot.
Currently this view can be filtered by keywords BUT
I would also like it to be "filter-able" based on Post Author (ideally from a drop down of all current user names).
Is that even possible?
Hello,
There isn't such kind of built-in feature within Toolset plugins, you might consider custom codes, for example:
1) Create a custom shortcode to output the users as a dropdown:
add_shortcode("list-of-authors", "list_of_authors");
function list_of_authors() {
$out = '<select name="author-filter">';
$out .= '<option value="">All Users</option>';
$users = get_users();
foreach ($users as $user) {
$selection = (isset($_GET['author-filter']) ? $_GET['author-filter']: '');
$out .= '<option ' . selected($user->ID, $selection, false) . ' value="' . $user->ID . '">' . $user->display_name . '</a>';
}
$out .= '</select>';
return $out;
}
2) Put above shortcode into the custom search form:
You can setup specific parameters in get_users() function, see WP document:
https://developer.wordpress.org/reference/functions/get_users/
I'm not sure I understand properly how to incorporate this shortcode into the view "filters".
It doesn't necessarily HAVE to be a drop down list.
A string search box (to search and filter for part matching usernames) would also serve the purpose.
As I mentioned above there isn't such kind of built-in feature within Toolset plugins, you can put the custom shortcode into the your view's custom search form. For example:
1) edit the post view, put that shortcode [list-of-authors] into section "Search and Pagination"
It will pass author's id as URL parameter.
2) in section "Query Filter", add a post author filter:
Select posts with the author's id determined by the URL parameter "author-filter" eg. yoursite/page-with-this-view/?author-filter=1
for the new question:
A string search box (to search and filter for part matching usernames) would also serve the purpose.
I assume you are going to filter the result by: author's name "LIKE" user's input.
No, there isn't such kind of built-in feature within Toolset Views plugin, see WP document:
https://developer.wordpress.org/reference/classes/wp_query/#author-parameters
There isn't "LIKE" comparison