Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 如何更改插入到“中”的html代码;添加介质“;?_Wordpress - Fatal编程技术网

Wordpress 如何更改插入到“中”的html代码;添加介质“;?

Wordpress 如何更改插入到“中”的html代码;添加介质“;?,wordpress,Wordpress,编辑页面内容时,TinyMCE编辑器上方有一个“添加媒体”按钮。该链接将指向该文件的链接插入页面内容 如何更改基于文件类型/mime类型插入的html代码?您需要使用过滤器 $html是将要插入到文章中的代码。类似于 $send\u id是正在插入的附件的id。使用它来获取有关附件的信息,例如 $attachment是一个具有以下结构的数组: array( ['menu_order'] => ['post_title'] => 'README' ['post_

编辑页面内容时,TinyMCE编辑器上方有一个“添加媒体”按钮。该链接将指向该文件的链接插入页面内容


如何更改基于文件类型/mime类型插入的html代码?

您需要使用过滤器

$html
是将要插入到文章中的代码。类似于

$send\u id
是正在插入的附件的id。使用它来获取有关附件的信息,例如

$attachment
是一个具有以下结构的数组:

array(
    ['menu_order'] =>
    ['post_title'] => 'README'
    ['post_excerpt'] =>
    ['post_content'] =>
    ['url'] => 'http://example.com/wp-content/uploads/2012/11/README.rtf'
)
array(
    ['menu_order'] =>
    ['post_title'] => 'README'
    ['post_excerpt'] =>
    ['post_content'] =>
    ['url'] => 'http://example.com/wp-content/uploads/2012/11/README.rtf'
)