我会在这里调查这个问题https://stackoverflow.com/questions/36564293/extract-urls-from-a-string-using-php
您可以使用上述链接检测在您的短代码中执行类似操作:
<?php
function pods_current_user($atts) {
extract(shortcode_atts(array(
\'currUser\' => get_current_user_id(),
), $atts));
extract(shortcode_atts(array(
\'field\' => "display_name",
), $atts));
$message = do_shortcode(\'[pods name="user" where="ID = \'.$currUser.\'"] {@\'.$field.\'}[/pods]\');
preg_match_all(\'#\\bhttps?://[^,\\s()<>]+(?:\\([\\w\\d]+\\)|([^,[:punct:]\\s]|/))#\', $message, $match);
// Do something with your links via the $match array.
return $message;
}
add_shortcode(\'getShortCode\', \'pods_current_user\');