Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

As we're evaluating whether we should build a Wordpress plugin and in that context I'm trying to figure out how Wordpress handles script tags in a post?

What's the default setting?

Thanks!

share|improve this question
add comment

1 Answer

Scripts shouldn't go inside the body of a post, but it is possible for administrator level users.

See the codex info on Javascript_in_Posts.

If you need JS inside a post, chances are you're approaching it from the wrong angle, content should go in the content area, not code.

However if you're looking to run code when something specific appears in a post, a better approach(imho) is to use a shortcode(or several), you can read more about them here.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.