I have a weird problem with a custom plugin.
This is the code to show inside a page:
// replace tag in content with myplugin
function myplugin_init($content){
if( strpos($content, '<!--myplugin-->') !== false ){
$code = myplugin_function();
$content = str_replace( '<!--myplugin-->', $code, $content );
}
return $content;
}
and then:
add_filter('the_content','myplugin_init');
Looks ok, but the plugin always show first in the page, no matter where I put it.
In my page have some text, and then: <!--myplugin-->. But the plugin goes first. The weird thing is the html code show the plugin code first, so it's not only a css float, position problem.
I thinks the problem is the way the plugin replace the content. ¿Any ideas?
PS: Sorry about my english, not my native language.