Easy native HTML5 forms for WordPress. Version 1.5 is unmaintained, but works without issue. 2.0 has been rewritten from the ground, and can be found at https://github.com/libreform/libreform
My customer uses polylang plugin to create a form for each language (I did not know the native integration that wplf has). So some forms, some forms did not appear in the filter dropdown. But with WP_Query it appears (I don't know why).
Optimizations
A new WP_Query object runs five queries by default, including calculating pagination and priming the term and meta caches. Each of the following arguments will remove a query:
'no_found_rows' => true: useful when pagination is not needed.
'update_post_meta_cache' => false: useful when post meta will not be utilized.
'update_post_term_cache' => false: useful when taxonomy terms will not be utilized.
Note: get_posts() actually calls WP_Query, but calling get_posts() directly bypasses a number of filters by default. Not sure whether you need these things or not? You probably don’t.
Reason
My customer uses polylang plugin to create a form for each language (I did not know the native integration that wplf has). So some forms, some forms did not appear in the filter dropdown. But with
WP_Query
it appears (I don't know why).Optimizations
A new
WP_Query
object runs five queries by default, including calculating pagination and priming the term and meta caches. Each of the following arguments will remove a query:'no_found_rows' => true
: useful when pagination is not needed.'update_post_meta_cache' => false
: useful when post meta will not be utilized.'update_post_term_cache' => false
: useful when taxonomy terms will not be utilized.Note:
get_posts()
actually callsWP_Query
, but callingget_posts()
directly bypasses a number of filters by default. Not sure whether you need these things or not? You probably don’t.Based on: https://10up.github.io/Engineering-Best-Practices/php/#performance