Skip to:
Content
Pages
Categories
Search
Top
Bottom

`bp_get_activity_latest_update` should use curly quotes

  • @joeyday

    Participant

    The bp_get_activity_latest_update function uses straight quotes, and I’m just anal retentive enough that it’s bugging me. I know where and how to edit the core code to fix this, but I wonder if there’s a better way. Anybody have any idea how I could write a plugin that would fix it?

    The following code:

    function bp_get_activity_latest_update( $user_id = false ) {

    global $bp;

    if ( !$user_id )

    $user_id = $bp->displayed_user->id;

    if ( !$update = get_usermeta( $user_id, 'bp_latest_update' ) )

    return false;

    $latest_update = '"' . trim( strip_tags( bp_create_excerpt( $update['content'], 40 ) ) ) . '"';

    $latest_update .= ' · root_domain . '/' . BP_ACTIVITY_SLUG . '/p/' . $update['id'] . '/"> ' . __( 'View', 'buddypress' ) . '';

    return apply_filters( 'bp_get_activity_latest_update', $latest_update );

    }

    Should be this instead:

    function bp_get_activity_latest_update( $user_id = false ) {

    global $bp;

    if ( !$user_id )

    $user_id = $bp->displayed_user->id;

    if ( !$update = get_usermeta( $user_id, 'bp_latest_update' ) )

    return false;

    $latest_update = '“' . trim( strip_tags( bp_create_excerpt( $update['content'], 40 ) ) ) . '”';

    $latest_update .= ' · root_domain . '/' . BP_ACTIVITY_SLUG . '/p/' . $update['id'] . '/"> ' . __( 'View', 'buddypress' ) . '';

    return apply_filters( 'bp_get_activity_latest_update', $latest_update );

    }

    Or perhaps it should just throw plain vanilla straight quotes in there (instead of the character entity code) and let wptexturize curl them the best-practices way.

    At any rate, short of editing the core code, what’s the best way to go about fixing this?

Viewing 1 replies (of 1 total)
  • @joeyday

    Participant

    Update: Putting plain vanilla straight quotes into the function does fix this. wptexturize properly curls the straight quotes for me, but if wptexturize were disabled (which I know some users prefer) the straight quotes would come through unmodified.

    Oh, and sorry about how the code displays above. I obviously don’t know how to use the code tags properly, and when I go back to edit my post, the textarea is blank. Weird.

Viewing 1 replies (of 1 total)
  • The topic ‘`bp_get_activity_latest_update` should use curly quotes’ is closed to new replies.
Skip to toolbar