I have problems with add_filter functions in WordPress.
Code:
function ftp_content_filter($content) {
$content = preg_replace("#\[form_to_pdf\]#si", ''.ftp_content().'',$content);
return $content;
}
add_filter('the_content', 'ftp_content_filter');
It's working , but i have ftp_content(); on every page.
Code [form_to_pdf] is only in page_id=3 and I want to have this function only on this page.
I thnik that 'the_content' is content from every page, so how can i filter only single (current open) page?
Thanks for help.
This way, you shortcode should work anywhere shortcodes do: