`bp_get_activity_latest_update` should use curly quotes
-
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?
- The topic ‘`bp_get_activity_latest_update` should use curly quotes’ is closed to new replies.