我有很多WordPress页面,我在这些页面中只使用了一个快捷码,例如,第1页的内容是[快捷码名称=“page1”],
第2页的内容为[短代码名称=“page2”],
第3页的内容是[短代码名称=“第3页”]
有没有可能我不需要在shortcode中指定name属性,而只需指定[shortcode],它会自动将页面的标题作为name属性
例如,在plugin中,我可以编写如下内容
function shortcode($atts)
{
extract(shortcode_atts(array(
\'name\' => "**title of the page**",
) , $atts));
......
}
add_shortcode(\'short_code\', \'short_code\');