WordPress.org

Ready to get started?Download WordPress

Forums

How to have a script in your post? (12 posts)

  1. gravity
    Member
    Posted 10 years ago #

    Hello...
    In the content of my post I want to use a <script>whatever</script> However, when I add it.. it just shows up as a blank. Kinda like it is ignoring it..
    What do I have to do in order to get a script to work in the text? Do I have to use a tag or something?
    Please advise...

  2. gravity
    Member
    Posted 10 years ago #

    I am just checking in to see if any of the gurus can anwer this..
    Kind regards,
    Gravity

  3. gravity
    Member
    Posted 10 years ago #

    Any chance the makers or someone could come up with a plugin that allows the <script></script> code to work in the post contents of wordpress.
    Currently WP cleans up the code and basically removes it.
    Any help would be appreciated.

  4. codergurl
    Member
    Posted 10 years ago #

    Do you want to display the tags or execute the code?

  5. gravity
    Member
    Posted 10 years ago #

    I want to execute the code between the tags.. I use Hiveware over at hiveware.com to enkode my email addresses on my sites.. I want to be able to also encode any email addresses that may appear in the content of the posts.
    I do not want to create spam for anyone on my site. Using the encoder stops this..
    Kind regards,
    Gravity

  6. eric
    Member
    Posted 10 years ago #

    I'd really like this function too. Judging from the Wiki API page it should not be too hard to impelement this as a filter, applied to comment_author_email and the_author_email. I'm still crap at coding stuff up in PHP though...

  7. TechGnome
    Moderator
    Posted 10 years ago #

    problem is.... how do you execute it?
    First, is this client-side javascript? (I'm guessing so since it's in script tags).... Well, you could look at the file that strips out unwanted HTML tags (used to be called kses.php or something like that, not sure what it is these days) and set it to allow the script tag. BUT... that means that it will allow script tags in comments - which some one could exploit.
    TG

  8. gravity
    Member
    Posted 10 years ago #

    Any more information on this? Gurus?
    Kind regards,
    Gravity

  9. eric
    Member
    Posted 10 years ago #

    TG, I gather from your comment that a single function in kses.php is used to strip scripts both out of posts and out of comments. Correct?
    Is there a way to apply that filter only to comments but not posts? I think this would solve the problem, as well as the related problem of including php code in a post, which has been discussed on this forum before.
    If there is currently no way to do this I'd like to make it a feature request. Or if posts rely on kses.php in some way (to make Quicktags work?), I would advocate having 2 separate functions, kses-posts.php and kses-comments.php or something along those lines.

  10. ckronengold
    Member
    Posted 9 years ago #

    any more progress on this?
    i'd like to insert an image into my posts, then when it is clicked on, run a javascript
    to play a .wmv file in a new window.
    I was able to make it work in b logger, but can't seem to get it to run in WP.
    thanks

  11. quiescent
    Member
    Posted 8 years ago #

    yea is there any solution to it?

  12. moshu
    Member
    Posted 8 years ago #

    Does this help? Using_Javascript

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.