Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Filter by Author
This topic contains 4 replies, has 2 voices, and was last updated by Ernest Marcinko 1 year, 6 months ago.
- AuthorPosts
- September 8, 2021 at 3:41 am #34588
I see that a feature for filtering by post_author has been requested at least about 2 years ago (https://wp-dreams.com/forums/topic/filter-by-author-2/) and you thought it might soon become a feature back then. But as of 5 months ago it still had not been implemented (and appears to still not be possible) – https://wp-dreams.com/forums/topic/filter-by-author-3/.
Do you have any estimation of when this might happen?
Regardless, for now do you think it might be possible to make a workaround by creating a function that uses a hook to create a custom metafield that contains the author ID and/or name, which could then perhaps be used as a custom field filter?
September 8, 2021 at 10:06 am #34597Hi,
Unfortuantely some features get pushed around a lot, usually I rather does not give estimations because of that. This feature is one of them.
The meta field/id solution could actually work perfectly for this case, I see no problem with that.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
September 8, 2021 at 7:08 pm #34618Thanks! I was able to create a function and hook to generate a metafield for one post type, but am struggling with all post types. It worked though, and I’ll keep working to figure it out. You can close this ticket now.
September 8, 2021 at 10:52 pm #34619FYI, this snippet appears to work to create a post author metafield for use with custom field filtering.
function add_post_author_metafield ( $post_id, $post) {
update_post_meta($post_id, ‘post_author_meta’, get_userdata($post->post_author)->user_nicename);
}
add_action( ‘wp_insert_post’, ‘add_post_author_metafield’, 10, 2 );Perhaps you’d like to share it with the community, given that it has been a requested feature?
And, while I have your attention here, I sent a few follow-up questions to you regarding my pre-sale inquiry email. I’m sure you’re busy, but I would appreciate if you could take a look and respond. On that note, are tickets the best way to reach you?
Attachments:
You must be logged in to view attached files.September 9, 2021 at 8:38 am #34627Thank you very much for sharing!
Support tickets are better if you have support related questions, I always do those first. Pre-sales questions are also important, but obviously support has much higher priority.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.