Home › Forums › Bug Reports › Search not working on Relationship Field in WordPress 4.0 › Reply To: Search not working on Relationship Field in WordPress 4.0
This boils down to line 116 in advanced-custom-fields/core/fields/relationship.php:
$where .= " AND " . $wpdb->posts . ".post_title LIKE '%" . esc_sql( like_escape( $title ) ) . "%'";
Using WordPress 4.0 syntax, this is now:
$where .= " AND " . $wpdb->posts . ".post_title LIKE '%" . esc_sql( $wpdb->esc_like( $title ) ) . "%'";
(this works even when WP_DEBUG is true)
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.