WordPress.org

Ready to get started?Download WordPress

Forums

Plugin adding to head tag after analyzing the_content (1 post)

  1. tomgf
    Member
    Posted 6 years ago #

    I'm writing a simple form to mail plugin.

    My goal is to have the possibility of adding a tag to the content, like this:

    [form 1 EN] (meaning form number 1 in English)

    This tag is captured by a filter:
    add_filter('the_content', array(&$this, 'the_content_filter'), 9);

    The function the_content_filter prints the proper form.

    My problem is that I have to add some javascripts (I'm using jQuery with some plugins) if - and only if - the_content is having a form.

    How can I pass this to the head tag in order to insert the proper code for javascripts there (without including unnecesary this scripts on every page or post)...?

Topic Closed

This topic has been closed to new replies.

About this Topic