Skip to content

Commit 167443a

Browse files
Merge pull request #316 from djalondon/patch-1
Update lcp-parameters.php
2 parents 54b6068 + 042e90b commit 167443a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

include/lcp-parameters.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,13 @@ public function starting_with($where){
300300

301301
// Support for both utf8 and utf8mb4
302302
global $wpdb;
303-
$charset = $wpdb->get_col_charset('wp_posts', 'post_title');
303+
$wp_posts_prefix = $wpdb->prefix . 'posts';
304+
$charset = $wpdb->get_col_charset($wp_posts_prefix, 'post_title');
304305

305-
$where .= 'AND (wp_posts.post_title ' .
306+
$where .= 'AND (' . $wp_posts_prefix . '.post_title ' .
306307
'COLLATE ' . strtoupper($charset) . '_GENERAL_CI LIKE \'' . $letters[0] . "%'";
307308
for ($i=1; $i <sizeof($letters); $i++) {
308-
$where .= 'OR wp_posts.post_title ' .
309+
$where .= 'OR ' . $wp_posts_prefix . '.post_title ' .
309310
'COLLATE ' . strtoupper($charset) . '_GENERAL_CI LIKE \'' . $letters[$i] . "%'";
310311
}
311312
$where.=')';

0 commit comments

Comments
 (0)