feat(form): allow forms to be queried based on close status #2250
Occasionally, users want to have an archive of Give forms, but exclude those that are closed because they achieved their goal. We currently have
referenced this issue
Jan 22, 2018
Rethinking this one through... wouldn't it be better to have function like:
I'm putting this in 2.1 as I think it will become more requested when we introduce the form grid shortcode.
@DevinWalker We already have
What we need is a way to query only forms that are published and open. A more performant solution that will work with pagination is to add a custom post status called
We can hook into the completed donation and check to see if the form should be closed at that point. That way the calculation occurs after the donation rather than during each query in the archive.
If we like the custom status approach, we should also add a
changed the title
feat(form): allow forms to be queried based on goal status
Apr 9, 2018
I've researched on this and found that currently there is no way to add custom post status to Publish meta box. I've found 8 years old open Trac ticket which is still under
Also, I have found an alternative solution to implement the custom post status to Publish meta box using inline scripts. Refer: http://jamescollings.co.uk/blog/wordpress-create-custom-post-status/
Let me know your thoughts on this.
I think it is fine if the
The suggestion in #2250 (comment) does not address the need to query forms by closed status. It only provides the functionality to check if an individual form is closed.
If we want to avoid the post status solution, then the alternative would be post meta or hidden taxonomy, but post status is the simplest query from a MySQL perspective.
I think if we will use post_meta logic then it will be clean. Since we are using custom meta table, so performance will not be a big issue. On basis of custom meta, we can show custom post status on form edit screen which will inform admin about form status.
@kevinwhoffman let me know what do you think
I recommend we use
Updated tasks below: