因此,我设置了一个Pod作为短代码,它输出用户上传文件的链接。下面是我制作的以下短代码(假设我的短代码是[getShortCode field="upload_files"]
:
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]\');
return $message;
}
add_shortcode(\'getShortCode\', \'pods_current_user\');
目前,它输出的是一组到上传文件的链接,但作为纯文本,而不是超链接。如下所示:http://secureservercdn.net/196.71.233.106/7ho.fa0.myftpupload.com/wp-content/uploads/2019/11/Screnshot-5.png?time=1575937207 http://secureservercdn.net/196.71.233.106/7ho.fa0.myftpupload.com/wp-content/uploads/2069/11/Geting-started-with-OneDrive-1.pdf?time=1675037207
(没有超链接)。有没有一种方法可以将链接从我的一个变量分离到一个可伸缩的数组中,就在我的快捷码函数中?比如可能检测到http
是这样分开链接的吗?谢谢