Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Filter by Author
- This topic has 4 replies, 2 voices, and was last updated 4 years, 8 months ago by
Ernest Marcinko.
-
AuthorPosts
-
September 8, 2021 at 3:41 am #34588
nickchomey18
ParticipantI 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 #34597Ernest Marcinko
KeymasterHi,
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.
September 8, 2021 at 7:08 pm #34618nickchomey18
ParticipantThanks! 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 #34619nickchomey18
ParticipantFYI, 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?
September 9, 2021 at 8:38 am #34627Ernest Marcinko
KeymasterThank 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.
-
AuthorPosts
- You must be logged in to reply to this topic.