WP_CLI\Utils
esc_like()
First half of escaping for LIKE special characters % and _ before preparing for MySQL.
Use this only before wpdb::prepare() or esc_sql(). Reversing the order is very bad for security.
Copied from core "wp-includes/wp-db.php". Avoids dependency on WP 4.4 wpdb.
Хуков нет.
Возвращает
Строку
. Text in the form of a LIKE phrase. The output is not SQL safe. Call $wpdb::prepare() or real_escape next.
Использование
esc_like( $text );
- $text(строка) (обязательный)
- The raw text to be escaped. The input typed by the user should have no extra or deleted slashes.
Код esc_like() esc like WP-CLI 2.8.0-alpha
function esc_like( $text ) { return addcslashes( $text, '_%\\' ); }