Forum Replies Created
Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorPosts
-
January 25, 2017 at 12:53 pm in reply to: Piklist_Form using set_transient prevents caching form using page-cache #7752
torarnvMemberTechnically, a transient can also expire before the timeout, at any time, so the form validation may fail regardless of caching, say if the user spends a bit of time filling out the form.
torarnvMemberApologies, should be:
// Ensure that custom post statues are also included in taxonomy counts function update_foo_term_count($terms, $taxonomy) { $include_all_statuses = function($sql) { return str_replace("post_status = 'publish'", "post_status NOT IN ('inherit','auto-draft','trash')", $sql); }; add_filter('query', $include_all_statuses); _update_post_term_count($terms, $taxonomy); remove_filter('query', $include_all_statuses); }
torarnvMemberHere’s a minimal trick to include the custom post statues in the count:
// Ensure that custom post statues are also included in taxonomy counts function update_registration_term_count($terms, $taxonomy) { function include_all_statuses($sql) { return str_replace("post_status = 'publish'", "post_status NOT IN ('inherit','auto-draft','trash')", $sql); } add_filter('query', 'include_all_statuses'); _update_post_term_count($terms, $taxonomy); remove_filter('query', 'include_all_statuses'); } -
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)