How to add_action just when the plugin works??
-
Hi, i’m still writing my download manager plugin everything is ok except one problem.
I use preg_match to find the code from content (html comment like < ! — — >) and replace with html code with the download information etc.
Basically the plugin search the_content with add_filter(‘the_content’, ‘replace_code’); and i put add_action(‘wp_head’, ‘add_css’); in “my_function_one” so when the plugin works, it also add “add_css” in wp_head.
In single page, everything works great, but in the frontpage and page my “add_css” function is not executed but “replace_code” function is ok. Can someone help me about this problem? Or maybe give me some reference?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘How to add_action just when the plugin works??’ is closed to new replies.