Skip to:
Content
Pages
Categories
Search
Top
Bottom

Post code between backticks

  • Profile photo of Boone Gorges
    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)
  • Profile photo of Paul Gibbs
    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

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

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

    Profile photo of Boone Gorges
    Boone Gorges
    Keymaster

    @boonebgorges

    Yup, tag closing should be next :)

    Profile photo of rich! @ etiviti
    rich! @ etiviti
    Participant

    @nuprn1

    schweet!

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

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

    Profile photo of Jeff Sayre
    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!

    Profile photo of Hugo Ashmore
    Hugo Ashmore
    Moderator

    @hnla

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

    Profile photo of Boone Gorges
    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?

    Profile photo of @mercime
    @mercime
    Moderator

    @mercime

    ‘?php backtick_is_back(); ?’

    Profile photo of Hugo Ashmore
    Hugo Ashmore
    Moderator

    @hnla

    For mercime:

    Profile photo of @mercime
    @mercime
    Moderator

    @mercime

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

    Profile photo of paulhastings0
    paulhastings0
    Participant

    @paulhastings0

    :woot:

    Profile photo of Zen Gonzaga
    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