Support » Plugin: Jetpack by WordPress.com » Google Plus – can't handle Apostrophe in Author Name

  • Resolved darrell.odonnell

    (@darrellodonnell)


    If there is an apostrophe in the g+ profile (e.g. Darrell O’Donnell <- me) the name will show with a \ (Darrell O\’Donnell).

    Here is a possible (works for me) fix:

    Change function byline:

    function byline( $post ) {
    		$author = $this->information( $post->post_author );
    		$image = '<img src="' . esc_url( $author['profile_image'] ) . '?sz=40" alt="" width="20" height="20" align="absmiddle" /> ';
    		$byline = sprintf( '<a href="%1$s">%2$s</a><a rel="author" href="%1$s" class="gplus-profile">%3$s</a>', esc_url( $author['url'] ), $image, esc_html( $author['name'] ) );
    		return apply_filters( 'gplus_authorship_byline', $byline, $post );
    	}

    TO:

    function byline( $post ) {
    		$author = $this->information( $post->post_author );
    		$image = '<img src="' . esc_url( $author['profile_image'] ) . '?sz=40" alt="" width="20" height="20" align="absmiddle" /> ';
    		$byline = sprintf( '<a href="%1$s">%2$s</a><a rel="author" href="%1$s" class="gplus-profile">%3$s</a>', esc_url( $author['url'] ), $image, stripslashes(esc_html( $author['name'] )) );
    		return apply_filters( 'gplus_authorship_byline', $byline, $post );
    	}

    http://wordpress.org/plugins/jetpack/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Google Plus – can't handle Apostrophe in Author Name’ is closed to new replies.