• Hi! Thanks for your great job!

    Can you please give some advice how to check any shortcode exist in php way?

    For example I need to load some extra js in head section if any shortcode is used onpage.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author vaakash

    (@vaakash)

    Hi @channel856,

    Thanks for using Shortcoder.

    I’m afraid that won’t be possible. It is not possible to predict what shortcodes will be used in a page, since page is loaded linearly from top to bottom.

    This looks like something beyond the plugin’s scope.

    My suggestion would be hardcode the condition on where the script has to be loaded in the header.

    Thanks,
    Aakash

    Thread Starter channel856

    (@channel856)

    Hi! Thanks for your answer and sorry for long delay.

    Actually I need to load additional js-script in the head section of any page where some shortcode is used.

    Is it possible for now or can you add this great feature to future versions?

    Plugin Author vaakash

    (@vaakash)

    Hi @channel856,

    Right now this feature is not possible. This is something which needs special implementation because we cannot look ahead if a shortcode is used on a page and insert scripts in the header.

    I do have this in my todo list. But I cannot promise any time for this feature. For now I can suggest some other plugins like “header and footer” scripts for the same.
    Hope you understand.

    Thanks,
    Aakash

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘shortcode used php code’ is closed to new replies.