我有这个短代码
[broo_user_badges username=""]
我必须将用户名放在“”之间,但用户名位于URL:/author/peter中。所以,当页面域。com/author/peter已加载,在该页面上应生成此短代码:[broo_user_badges username="peter"]
我找到了这个add_shortcode(\'name\', \'get_name\');
function get_name() {
return $_GET[\'name\'];
}
在这里How to get URL param to shortcode?但我不明白如何在我的案例中使用它(/作者/peter url结构)。