I have programmed a short-code plug-in that also needs the post wpautop disabled but I want the wpautop to be disabled ONLY is the short-code is actually used in the post.
Can someone help me out with this,, I can't seem to figure it out.
I have programmed a short-code plug-in that also needs the post wpautop disabled but I want the wpautop to be disabled ONLY is the short-code is actually used in the post.
Can someone help me out with this,, I can't seem to figure it out.
Anyone?
I am sure someone with more experience can figure this out.
Inside the loop, you can do this:
//save the_content in temp var
$tempcontent = get_the_content();
//write here only the begining of the shortcode you need to check
$tempseek = '[gallery';
$temppos = strpos($tempcontent,$tempseek);
if($temppos === false) {
//Shortcode not found
} else {
//Shortcode FOUND, do what you need here
}This topic has been closed to new replies.