Skip to content

Commit

Permalink
limit to pages for shortcode query
Browse files Browse the repository at this point in the history
  • Loading branch information
rlankhorst committed May 27, 2024
1 parent 3d8c9ab commit 0458d0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions documents/class-document.php
Original file line number Diff line number Diff line change
Expand Up @@ -1682,13 +1682,13 @@ 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'",
"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' . '%'
);

$pages = $wpdb->get_results($query);

$type_region = ( $region === 'eu' ) ? $type : $type . '-' . $region;

/**
Expand Down

0 comments on commit 0458d0e

Please sign in to comment.