sanitize_title_for_query()清理标题用于数据库查询中

目录

描述

清理标题用于  库查询中,函 中调  sanitize_title($title, "", "query") 细看 sanitize_title()

sanitize_title_for_query() 描述

用法

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */
<?php sanitize_title_for_query( $title ); ?>

sanitize_title_for_query() 用法

参数

$title

(string) (必填)  清理的标 

默认值: None

sanitize_title_for_query() 参数

返回值

(string) 

清理之后的标题

sanitize_title_for_query() 返回值

注意

Since sanitize_title_for_query() calls sanitize_title(), the sanitize_title 过滤器 is applied with a context of 'query'.

sanitize_title_for_query() 注意

历史

添加于 版本: 1.0.0

sanitize_title_for_query() 历史

源文件

sanitize_title_for_query() 函数的代码位于 /wp-includes/formatting.php.

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */
/**
 * Sanitizes a title with the 'query' context.
 *
 * Used for querying the database for a value from URL.
 *
 * @since 3.1.0
 *
 * @param string $title The string to be sanitized.
 * @return string The sanitized string.
 */
function sanitize_title_for_query( $title ) {
	return sanitize_title( $title, '', 'query' );
}

sanitize_title_for_query() 源文件