Filter by Author

This topic contains 4 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 2 years, 7 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #34588
    nickchomey18
    nickchomey18
    Participant

    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?

    #34597
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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 :)


    #34618
    nickchomey18
    nickchomey18
    Participant

    Thanks! 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.

    #34619
    nickchomey18
    nickchomey18
    Participant

    FYI, 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.
    #34627
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Thank 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 :)


Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.