From ac93ed4d29dd85409fb4c0cd9c2af266e90777c1 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sat, 19 Oct 2024 10:04:14 +0200 Subject: initial commit --- WP/search-by-title-with-wp-query.php | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 WP/search-by-title-with-wp-query.php (limited to 'WP/search-by-title-with-wp-query.php') diff --git a/WP/search-by-title-with-wp-query.php b/WP/search-by-title-with-wp-query.php new file mode 100644 index 0000000..418f057 --- /dev/null +++ b/WP/search-by-title-with-wp-query.php @@ -0,0 +1,11 @@ +get('title_like')) { + global $wpdb; + $where .= " AND {$wpdb->posts}.post_title LIKE '" . esc_sql($wpdb->esc_like($title)) . "'"; + } + + return $where; +}, 10, 2); -- cgit v1.2.3