嗨,我只是想知道是否有一種方法來獲取[嵌入] [/嵌入]短代碼的內部。我試過這種方法,但沒有佔上風。感謝Wordpress從內容獲取短代碼鏈接
$argsabc = extract(shortcode_atts(array(
'embed' => ''
), $this->post['post_content']));
嗨,我只是想知道是否有一種方法來獲取[嵌入] [/嵌入]短代碼的內部。我試過這種方法,但沒有佔上風。感謝Wordpress從內容獲取短代碼鏈接
$argsabc = extract(shortcode_atts(array(
'embed' => ''
), $this->post['post_content']));
get_shortcode_regex()
請使用來完成它。希望它能爲你工作。 更多信息:http://codex.wordpress.org/Function_Reference/get_shortcode_regex
謝謝,幫助了很多 – 2014-12-05 10:41:41
聽到這個很好。 – Tristup 2014-12-05 10:43:42
不清楚你的查詢,請你解釋一下更多。 – Tristup 2014-12-05 10:31:55
在post_content中有一個簡短的代碼,其中有一個youtube鏈接,就像這樣[embed] http://www.youtube.com/?v=videourl [/ embed]我需要的是它內部的鏈接 – 2014-12-05 10:34:08
Ok明白了。讓我給你答案。 – Tristup 2014-12-05 10:36:09