Skip to content

Commit d5520db

Browse files
luizbillstimiwahalahti
authored andcommitted
form query optimizations (#159)
1 parent 0c3f1da commit d5520db

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

classes/class-cpt-wplf-submission.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,14 @@ public function form_filter_dropdown() {
130130
if ( $transient ) {
131131
$forms = $transient;
132132
} else {
133-
$forms = get_posts( array(
133+
$query = new WP_Query( array(
134134
'post_per_page' => '-1',
135135
'post_type' => 'wplf-form',
136+
'no_found_rows' => true,
137+
'update_post_meta_cache' => false,
138+
'update_post_term_cache' => false,
136139
) );
140+
$forms = $query->get_posts();
137141

138142
set_transient( 'wplf-form-filter', $forms, 15 * MINUTE_IN_SECONDS );
139143
}

0 commit comments

Comments
 (0)