Skip to content

Commit

Permalink
Merge pull request #374 from WordPress/og-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
amieiro authored Oct 23, 2024
2 parents b4ea2e3 + 5b9b862 commit b67da69
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions templates/parts/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,23 @@ function () use ( $html_title, $url, $html_description, $image_url ) {
echo '<link rel="alternate" type="application/rss+xml" title="' . esc_html__( 'Translating Events &raquo; WordPress Feed', 'gp-translation-events' ) . '" href="' . esc_url( home_url( gp_url( '/events/feed' ) ) ) . '" />' . "\n";
echo '<meta name="twitter:card" content="summary" />' . "\n";
echo '<meta name="twitter:site" content="@WordPress" />' . "\n";
echo '<meta name="twitter:title" content="' . esc_attr( $html_title ) . '" />' . "\n";
echo '<meta name="twitter:description" content="' . esc_attr( $html_description ) . '" />' . "\n";
echo '<meta name="twitter:title" content="' . esc_attr( wp_strip_all_tags( $html_title ) ) . '" />' . "\n";
echo '<meta name="twitter:description" content="' . esc_attr( wp_strip_all_tags( $html_description ) ) . '" />' . "\n";
echo '<meta name="twitter:creator" content="@WordPress" />' . "\n";
echo '<meta name="twitter:image" content="' . esc_url( $image_url ) . '" />' . "\n";
echo '<meta name="twitter:image:alt" content="' . esc_attr( $html_title ) . '" />' . "\n";

echo '<meta property="og:url" content="' . esc_url( $url ) . '" />' . "\n";
echo '<meta property="og:title" content="' . esc_attr( $html_title ) . '" />' . "\n";
echo '<meta property="og:description" content="' . esc_attr( $html_description ) . '" />' . "\n";
echo '<meta property="og:title" content="' . esc_attr( wp_strip_all_tags( $html_title ) ) . '" />' . "\n";
echo '<meta property="og:description" content="' . esc_attr( wp_strip_all_tags( $html_description ) ) . '" />' . "\n";
echo '<meta property="og:site_name" content="' . esc_attr( get_bloginfo() ) . '" />' . "\n";
echo '<meta property="og:image:url" content="' . esc_url( $image_url ) . '" />' . "\n";
echo '<meta property="og:image:secure_url" content="' . esc_url( $image_url ) . '" />' . "\n";
echo '<meta property="og:image:type" content="image/png" />' . "\n";
echo '<meta property="og:image:width" content="1200" />' . "\n";
echo '<meta property="og:image:height" content="675" />' . "\n";
echo '<meta property="og:image:alt" content="' . esc_attr( $html_title ) . '" />' . "\n";
echo '<meta property="og:type" content="event" />' . "\n";
}
);
gp_title( $html_title );
Expand Down

0 comments on commit b67da69

Please sign in to comment.