不是这样,但如果在短代码中使用预定义的值或参数作为“标志”,则可以获得相同的结果:
[authoorsposts author="post"]
。。。然后在处理程序中:
function wpse_209684_author( $atts ) {
if ( ! empty( $atts[\'author\'] ) ) {
$author = $atts[\'author\'];
if ( $author === \'post\' ) // Our flag, make $author the current post author
$author = get_the_author_id();
else // Otherwise just accept a hardcoded author ID
$author = absint( $author );
}
}