css
4 years ago
images
12 years ago
img
13 years ago
js
4 years ago
archiveorg-book.php
4 years ago
archiveorg.php
4 years ago
archives.php
5 years ago
bandcamp.php
5 years ago
brightcove.php
5 years ago
cartodb.php
5 years ago
class.filter-embedded-html-objects.php
5 years ago
codepen.php
5 years ago
crowdsignal.php
5 years ago
dailymotion.php
4 years ago
descript.php
4 years ago
facebook.php
5 years ago
flatio.php
5 years ago
flickr.php
5 years ago
getty.php
5 years ago
gist.php
5 years ago
googleapps.php
5 years ago
googlemaps.php
5 years ago
googleplus.php
5 years ago
gravatar.php
5 years ago
houzz.php
5 years ago
inline-pdfs.php
4 years ago
instagram.php
4 years ago
kickstarter.php
5 years ago
mailchimp.php
5 years ago
medium.php
5 years ago
mixcloud.php
5 years ago
others.php
5 years ago
pinterest.php
5 years ago
presentations.php
5 years ago
quiz.php
4 years ago
recipe.php
5 years ago
scribd.php
5 years ago
sitemap.php
5 years ago
slideshare.php
5 years ago
slideshow.php
4 years ago
smartframe.php
4 years ago
soundcloud.php
4 years ago
spotify.php
4 years ago
ted.php
5 years ago
tweet.php
5 years ago
twitchtv.php
5 years ago
twitter-timeline.php
5 years ago
unavailable.php
4 years ago
untappd-menu.php
5 years ago
upcoming-events.php
5 years ago
ustream.php
5 years ago
videopress.php
5 years ago
vimeo.php
4 years ago
vine.php
5 years ago
vr.php
4 years ago
wordads.php
5 years ago
wufoo.php
4 years ago
youtube.php
4 years ago
googleplus.php
38 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Google+ embeds |
| 4 | * Google+ has shut down. Output the link for history's sake. |
| 5 | * Other than that, there's not much we can do. |
| 6 | * |
| 7 | * @package automattic/jetpack |
| 8 | */ |
| 9 | |
| 10 | define( 'JETPACK_GOOGLEPLUS_EMBED_REGEX', '#^https?://plus\.(sandbox\.)?google\.com/(u/\d+/)?([^/]+)/posts/([^/]+)$#' ); |
| 11 | |
| 12 | /* |
| 13 | * Example URL: https://plus.google.com/114986219448604314131/posts/LgHkesWCmJo |
| 14 | * Alternate example: https://plus.google.com/u/0/100004581596612508203/posts/2UKwN67MBQs (note the /u/0/) |
| 15 | */ |
| 16 | wp_embed_register_handler( 'googleplus', JETPACK_GOOGLEPLUS_EMBED_REGEX, 'jetpack_deprecated_embed_handler' ); |
| 17 | |
| 18 | add_shortcode( 'googleplus', 'jetpack_googleplus_shortcode_handler' ); |
| 19 | |
| 20 | /** |
| 21 | * Display the Google+ shortcode. |
| 22 | * |
| 23 | * @param array $atts Shortcode attributes. |
| 24 | */ |
| 25 | function jetpack_googleplus_shortcode_handler( $atts ) { |
| 26 | global $wp_embed; |
| 27 | |
| 28 | if ( empty( $atts['url'] ) ) { |
| 29 | return; |
| 30 | } |
| 31 | |
| 32 | if ( ! preg_match( JETPACK_GOOGLEPLUS_EMBED_REGEX, $atts['url'] ) ) { |
| 33 | return; |
| 34 | } |
| 35 | |
| 36 | return sprintf( '<p>%s</p>', $wp_embed->shortcode( $atts, $atts['url'] ) ); |
| 37 | } |
| 38 |