WordPress at a glance
function is not described

WP_Term_Query::get_search_sql() protected WP 4.6.0

Used internally to generate a SQL string related to the 'search' parameter.

{} It's a method of the class: WP_Term_Query{}

No Hooks.

Return

String. Null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_search_sql( $string );
$string(string) (required)
-

Notes

  • Global. wpdb. $wpdb WordPress database abstraction object.

Changelog

Since 4.6.0 Introduced.

Code of WP_Term_Query::get_search_sql() WP 5.7

<?php
protected function get_search_sql( $string ) {
	global $wpdb;

	$like = '%' . $wpdb->esc_like( $string ) . '%';

	return $wpdb->prepare( '((t.name LIKE %s) OR (t.slug LIKE %s))', $like, $like );
}