Skip to content

Commit

Permalink
Merge pull request #418 from georgestephanis/enhancement/find-page-qu…
Browse files Browse the repository at this point in the history
…ery-optimization

Add an extra clause to the `get_shortcode_page_id` mysql query.
  • Loading branch information
rlankhorst authored May 30, 2024
2 parents eb0acba + 876d1bd commit 8f395ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion documents/class-document.php
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,7 @@ public function get_shortcode_page_id( $type, $region , $cache = true) {
//ensure a transient, in case none is found. This prevents continuing requests on the page list
cmplz_set_transient( "cmplz_shortcode_$type-$region", 'none', HOUR_IN_SECONDS );
$query = $wpdb->prepare(
"SELECT * FROM $wpdb->posts WHERE (post_content LIKE %s OR post_content LIKE %s) AND post_status = 'publish' AND post_type = 'page' ",
"SELECT * FROM $wpdb->posts WHERE (post_content LIKE %s OR post_content LIKE %s) AND post_status = 'publish' AND post_type = 'page'",
'%' . '[cmplz-document' . '%',
'%' . 'wp:complianz\/document' . '%'
);
Expand Down

0 comments on commit 8f395ce

Please sign in to comment.