diff --git a/documents/class-document.php b/documents/class-document.php index 7f924d47..63d6e6e5 100644 --- a/documents/class-document.php +++ b/documents/class-document.php @@ -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; /**