数字化技能提升教程,数字化时代生存宝典

数字化百科 / 产品文档 / WordPress:Function Reference/wp get attachment url

WordPress:Function Reference/wp get attachment url

查看全部产品文档命名空间:WordPress

描述

返回附属文件完全URI或者没有URI,返回false

<!—当你向一篇文章插入附件,并且选择链接到文件的时候,Wordpress使用这个函数,产生一个链接-->

例子用法 &输出

%%%<?php echo wp_get_attachment_url(12); ?>%%% 产出内容像http://wp.example.net/wp-content/uploads/文件名

参数

相关的

描述

你可以通过wp_get_attachment_url过滤器更改这个函数的输出。

如果你想要附属网页的URI,而不是附属文件本身,你可以使用get_attachment_link。