Skip to:
Content
Pages
Categories
Search
Top
Bottom

Post code between backticks


  • Boone Gorges
    Keymaster

    @boonebgorges

    The use of backticks for displaying code in forums has now been activated on buddypress.org. Check it out!

    `function tell_the_truth() {
    global $current_user;
    get_currentuserinfo();
    if ( $current_user->user_login == ‘boonebgorges’ )
    echo ‘Boone, you are the bomb dot com.’
    }
    add_action( ‘wp_head’, ‘tell_the_truth’ );
    `

Viewing 13 replies - 1 through 13 (of 13 total)

  • Paul Gibbs
    Keymaster

    @djpaul

    Syntax highlighting?

    Also, it’d be helpful if the patch for checking for closed tags were implemented on here: https://trac.buddypress.org/ticket/2359


    Roger Coathup
    Participant

    @rogercoathup

    `function really () {
    echo “so it would seem”;
    }`


    Boone Gorges
    Keymaster

    @boonebgorges

    Yup, tag closing should be next :)


    rich! @ etiviti
    Participant

    @nuprn1

    schweet!


    Roger Coathup
    Participant

    @rogercoathup

    something doesn’t seem right – everything is now in italics!


    Jeff Sayre
    Participant

    @jeffsayre

    Very cool. I guess we can’t be ticked anymore.

    `function i_am_ticked() {
    global $bp, $whose_ticked;

    if( $whose_ticked == ‘you’ && $bp->backticks != false ) {
    echo “We’re sorry, you can no longer be ticked”;
    } else {
    echo “Yep! You’re ticked!”;
    }
    }`

    This is an important improvement. Thanks, Ninjas!


    Hugo Ashmore
    Moderator

    @hnla

    The backticks are back; all hail the Boone, prince amongst men


    Boone Gorges
    Keymaster

    @boonebgorges

    @djpaul – Decided to go with the straightforward backtick before worrying about syntax highlighting, as the most popular option (Syntax Highlighter) (a) requires you to specify the language in order for highlighting to work correctly, which is a bit onerous for first time users, and (b) requires an extra click to get the popup with copyable, plaintext code, which again might be confusing for some. Maybe it makes sense to enable Syntax Highlighter as an undocumented feature, with backticks in place as a fallback? Thoughts?


    @mercime
    Moderator

    @mercime

    ‘?php backtick_is_back(); ?’


    Hugo Ashmore
    Moderator

    @hnla

    For mercime:


    @mercime
    Moderator

    @mercime

    Thank you @hnla, I shall add that in BP Codex :-)


    paulhastings0
    Participant

    @paulhastings0

    :woot:


    Zen Gonzaga
    Member

    @zen-gonzaga

    i typed ‘backticks’ but its not working. how am i gonna use this?

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Post code between backticks’ is closed to new replies.
Skip to toolbar