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