开发者 | luehrsen |
---|---|
更新时间 | 2013年1月9日 18:48 |
捐献地址: | 去捐款 |
PHP版本: | 3.0 及以上 |
WordPress版本: | 3.5 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
<p>
tags.
With that plugin you could place this function into the theme functions.php, Images and Iframes will no longer be wrapped in paragraphs.
`<?php
function add_block_elements($block_elements){
$block_elements[] = "iframe";
$block_elements[] = "img";
return $block_elements;
}
add_filter("wpautop_block_elements", add_block_elements);
?>`
This Plugin is brought to you by Luehrsen // Heinrich
/wp-content/plugins/
directoryYou should probably not use this plugin. But for further education I recommend to read the WordPress Codex page on filters.
If I were you, I would adopt this function into my theme for easier shipment. But always consider the risk of overwriting a potential newer, better and updated version of wpautop. If you do adopt this function, be sure to check the original wpautop function upon every Wordpress release and keep the function up to date.
Yes, indeed. That's why I opened a ticket, that has this goal.
By saying "This mangling should not be left to plugins." he is probably right in terms of standards and regulations. But I've seen enough occasions of this functionality being a necessity, that's why I'm lobbying to implement it into WP Core. But it still is a tricky issue, where you should know, what you're doing.