Title: Custom Filter Question
Last modified: August 21, 2016

---

# Custom Filter Question

 *  Resolved [roysmyth](https://wordpress.org/support/users/roysmyth/)
 * (@roysmyth)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/custom-filter-question/)
 * Hi,
 * Thanks for the custom filters. I have one set up and it makes life easy for the
   site users.
 * I’m having trouble figuring out how to implement another one. I have a value 
   in user meta that is an expiry date (unix time stamp). I want to email all users
   who are coming up to expiry. That is easy. For example: expiry_date < (today 
   + 4 weeks).
 * However, expiry date can also be zero or unset, which means something else and
   I don’t want to email those users. So I need to test 0 < expiry_date < (today
   + 4 weeks).
 * Is there a way to do that?
 * [https://wordpress.org/plugins/email-users/](https://wordpress.org/plugins/email-users/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Mike Walsh](https://wordpress.org/support/users/mpwalsh8/)
 * (@mpwalsh8)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/custom-filter-question/#post-5056521)
 * I think the easiest way to do this would be to create another meta value (e.g.
   about_to_expire) that you update using the mailusers_update_custom_meta_filters
   hook. Something like this:
 *     ```
       add_action( 'mailusers_update_custom_meta_filters', 'update_about_to_expire_meta_filter', 5 );
   
       function update_publicworks_meta_filter()
       {
           //  Some logic which updates the about_to_expire meta
           //  value for all users based on the desired criteria.
       }
       ```
   
 * Then you would use the “about_to_expire” meta filter just like you currently 
   do with your other filter.

Viewing 1 replies (of 1 total)

The topic ‘Custom Filter Question’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/email-users_a0e0cf.svg)
 * [Email Users](https://wordpress.org/plugins/email-users/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/email-users/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/email-users/)
 * [Active Topics](https://wordpress.org/support/plugin/email-users/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/email-users/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/email-users/reviews/)

## Tags

 * [custom filter](https://wordpress.org/support/topic-tag/custom-filter/)

 * 1 reply
 * 2 participants
 * Last reply from: [Mike Walsh](https://wordpress.org/support/users/mpwalsh8/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/custom-filter-question/#post-5056521)
 * Status: resolved