WordPress.org

Ready to get started?Download WordPress

Forums

New Method to Post Code (18 posts)

  1. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

    Put it in between backticks, as is indicated by the post form. Everything between backticks will be encoded.

  2. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

    Yes, ah, well then. There we go.

  3. Alex King
    Member
    Posted 10 years ago #

    This htmlspecialchars() magic needs to be added to the RSS feeds.

  4. NuclearMoose
    Member
    Posted 10 years ago #

    Hmmm....so how come when I come back to visit this thread I see the code and not the encoded results instead?? Weird.
    On Firefox, BTW, and it worked before.

  5. TechGnome
    Moderator
    Posted 10 years ago #

    How is this "better" or more efficient than useing code tags?
    TG

  6. LoganSix
    Member
    Posted 10 years ago #

    Good question.
    Let's check it out.
    <test>this is a code tag</test>
    <test>this is backticks tag</test>
    Well, it is quicker. But I would still like to see some better formatting with a change in color.

  7. WillM
    Member
    Posted 10 years ago #

    @TG - for some reason, code tags don't always work. This has been an issue for awhile. Glad its been fixed.
    @L6 - yeah, that really annoyed me when we first got the UGS - replacing useful screen area with a bunch of empty gray space - but you get used to it

  8. WillM
    Member
    Posted 10 years ago #

    Yeah, from what Alex said its using the htmlspecialchars function and that will render things like '&' as HTML entities.

  9. Zaaba
    Member
    Posted 10 years ago #

    Sorry for being absolutely daft here but...
    WHAT ON EARTH ARE BACKTICKS?
    I presume they bear no relation to ticks on an animal's back. LOL.
    Apologies in advance for the lame humour :)

  10. Beel
    Member
    Posted 10 years ago #

    It is the character under the tilde (~) near the upper left (probably) of your keyboard.

  11. azumone
    Member
    Posted 8 years ago #

    '<?php endwhile; ?>
    <?php rewind_posts(); ?>'

  12. moshu
    Member
    Posted 8 years ago #

    azumone,
    you are using 'single quotes' (which are under ["] double quotes).
    Backticks should be - as said above - under the [~].

  13. TechGnome
    Moderator
    Posted 8 years ago #

    -nevermind, forget I said anything. In fact, "youuuu didn't seee anything"

    snarf!

    -tg

  14. They aren't necessarily under the ~. On a UK keyboard, that's where # lives. The "Backtick"[1] lives to the left of 1 on my keyboard.

    I've said it before, I'll say it again. Asking people to mark code with a character they've never heard of rather than a more familiar tag isn't helpful for anyone...

    [1] A name which means nothing to a lot of people...

  15. IMO, <code> would be fine by me.

    I do find myself using backticks for code on my blog and on forums without realizing it though. lol

  16. abs
    Member
    Posted 8 years ago #

    back ticks didnt work for me... Any other solution?

  17. Mark Jaquith
    WordPress Lead Dev
    Posted 8 years ago #

    abs,
    this is meant for these forums... not for WordPress

    Example:

    code here

  18. spencerp
    Member
    Posted 8 years ago #

    Hahaha..another corpse (thread) dug up from the grave lmaO!...

    spencerp

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.