diff options
Diffstat (limited to 'plugins/jetpack/functions.opengraph.php')
-rw-r--r-- | plugins/jetpack/functions.opengraph.php | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/plugins/jetpack/functions.opengraph.php b/plugins/jetpack/functions.opengraph.php index 542d01f1..ef610af9 100644 --- a/plugins/jetpack/functions.opengraph.php +++ b/plugins/jetpack/functions.opengraph.php @@ -22,14 +22,14 @@ function jetpack_og_tags() { $og_output = "\n<!-- Jetpack Open Graph Tags -->\n"; $tags = array(); - $image_width = absint( apply_filters( 'jetpack_open_graph_image_width', 200 ) ); - $image_height = absint( apply_filters( 'jetpack_open_graph_image_height', 200 ) ); + $image_width = absint( apply_filters( 'jetpack_open_graph_image_width', 200 ) ); + $image_height = absint( apply_filters( 'jetpack_open_graph_image_height', 200 ) ); $description_length = 197; if ( is_home() || is_front_page() ) { - $site_type = get_option( 'open_graph_protocol_site_type' ); - $tags['og:type'] = ! empty( $site_type ) ? $site_type : 'blog'; - $tags['og:title'] = get_bloginfo( 'name' ); + $site_type = get_option( 'open_graph_protocol_site_type' ); + $tags['og:type'] = ! empty( $site_type ) ? $site_type : 'blog'; + $tags['og:title'] = get_bloginfo( 'name' ); $tags['og:description'] = get_bloginfo( 'description' ); $front_page_id = get_option( 'page_for_posts' ); @@ -44,13 +44,15 @@ function jetpack_og_tags() { $tags['fb:admins'] = $facebook_admins; } else if ( is_author() ) { - $tags['og:type'] = 'author'; + $tags['og:type'] = 'profile'; $author = get_queried_object(); - $tags['og:title'] = $author->display_name; - $tags['og:url'] = get_author_posts_url( $author->ID ); - $tags['og:description'] = $author->description; + $tags['og:title'] = $author->display_name; + $tags['og:url'] = get_author_posts_url( $author->ID ); + $tags['og:description'] = $author->description; + $tags['profile:first_name'] = get_the_author_meta( 'first_name', $author->ID ); + $tags['profile:last_name'] = get_the_author_meta( 'last_name', $author->ID ); } else if ( is_singular() ) { global $post; @@ -72,7 +74,7 @@ function jetpack_og_tags() { return; $tags['og:site_name'] = get_bloginfo( 'name' ); - $tags['og:image'] = jetpack_og_get_image( $image_width, $image_height ); + $tags['og:image'] = jetpack_og_get_image( $image_width, $image_height ); // Facebook whines if you give it an empty title if ( empty( $tags['og:title'] ) ) @@ -101,7 +103,7 @@ function jetpack_og_tags() { echo $og_output; } -function jetpack_og_get_image( $width = 50, $height = 50, $max_images = 4 ) { // Facebook requires thumbnails to be a minimum of 50x50 +function jetpack_og_get_image( $width = 200, $height = 200, $max_images = 4 ) { // Facebook requires thumbnails to be a minimum of 200x200 $image = ''; if ( is_singular() && !is_home() && !is_front_page() ) { |