css
2 weeks ago
images
1 year ago
img
4 weeks ago
js
6 months ago
archiveorg-book.php
6 months ago
archiveorg.php
6 months ago
archives.php
2 weeks ago
bandcamp.php
6 months ago
brightcove.php
5 months ago
cartodb.php
6 months ago
class.filter-embedded-html-objects.php
6 months ago
codepen.php
6 months ago
crowdsignal.php
5 months ago
dailymotion.php
6 months ago
descript.php
6 months ago
facebook.php
6 months ago
flatio.php
6 months ago
flickr.php
5 months ago
getty.php
6 months ago
gist.php
6 months ago
googleapps.php
6 months ago
googlemaps.php
3 weeks ago
googleplus.php
6 months ago
gravatar.php
6 months ago
houzz.php
6 months ago
inline-pdfs.php
6 months ago
instagram.php
6 months ago
kickstarter.php
6 months ago
mailchimp.php
5 months ago
medium.php
6 months ago
mixcloud.php
6 months ago
others.php
6 months ago
pinterest.php
6 months ago
presentations.php
6 months ago
quiz.php
6 months ago
recipe.php
6 months ago
scribd.php
6 months ago
shortcode-utils.php
6 months ago
sitemap.php
6 months ago
slideshare.php
6 months ago
slideshow.php
4 weeks ago
smartframe.php
6 months ago
soundcloud.php
6 months ago
spotify.php
6 months ago
ted.php
6 months ago
tweet.php
6 months ago
twitchtv.php
6 months ago
twitter-timeline.php
6 months ago
twitter.php
6 months ago
unavailable.php
6 months ago
untappd-menu.php
6 months ago
upcoming-events.php
6 months ago
ustream.php
6 months ago
videopress.php
6 months ago
vimeo.php
1 week ago
vine.php
6 months ago
vr.php
1 week ago
wufoo.php
6 months ago
youtube.php
3 months 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 |