get_shortcode_atts_regex

函式
get_shortcode_atts_regex ( No parameters )
返回值
  • (string) The shortcode attribute regular expression.
定義位置
相關方法
get_shortcode_regexshortcode_attsdo_shortcode_tagget_tag_regexstrip_shortcode_tag
引入
4.4.0
棄用
-

get_shortcode_atts_regex函式是一個WordPress函式,檢索用於解析短碼屬性的正規表示式模式: 這個函式不需要引數,並返回正規表示式模式。

檢索短碼屬性重碼。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function get_shortcode_atts_regex() {
return '/([w-]+)s*=s*"([^"]*)"(?:s|$)|([w-]+)s*=s*'([^']*)'(?:s|$)|([w-]+)s*=s*([^s'"]+)(?:s|$)|"([^"]*)"(?:s|$)|'([^']*)'(?:s|$)|(S+)(?:s|$)/';
}
function get_shortcode_atts_regex() { return '/([w-]+)s*=s*"([^"]*)"(?:s|$)|([w-]+)s*=s*'([^']*)'(?:s|$)|([w-]+)s*=s*([^s'"]+)(?:s|$)|"([^"]*)"(?:s|$)|'([^']*)'(?:s|$)|(S+)(?:s|$)/'; }
function get_shortcode_atts_regex() {
	return '/([w-]+)s*=s*"([^"]*)"(?:s|$)|([w-]+)s*=s*'([^']*)'(?:s|$)|([w-]+)s*=s*([^s'"]+)(?:s|$)|"([^"]*)"(?:s|$)|'([^']*)'(?:s|$)|(S+)(?:s|$)/';
}

常見問題

FAQs
檢視更多 >