Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wpcom/shortcodes 17feb2017 #6440

Merged
merged 6 commits into from
Feb 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions modules/shortcodes/googleplus.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,10 @@
wp_embed_register_handler( 'googleplus', JETPACK_GOOGLEPLUS_EMBED_REGEX, 'jetpack_googleplus_embed_handler' );

function jetpack_googleplus_embed_handler( $matches, $attr, $url ) {
static $did_script;

if ( ! $did_script ) {
$did_script = true;
add_action( 'wp_footer', 'jetpack_googleplus_add_script' );
}

wp_enqueue_script( 'jetpack-gplus-api', 'https://apis.google.com/js/plusone.js', array(), null, true );
return sprintf( '<div class="g-post" data-href="%s"></div>', esc_url( $url ) );
}

function jetpack_googleplus_add_script() {
?>
<script src="https://apis.google.com/js/plusone.js"></script>
<?php
}

add_shortcode( 'googleplus', 'jetpack_googleplus_shortcode_handler' );

function jetpack_googleplus_shortcode_handler( $atts ) {
Expand Down
14 changes: 12 additions & 2 deletions modules/shortcodes/slideshare.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,15 @@ function slideshare_shortcode( $atts ) {

$player .= ' allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe>';

return $player;
}
/**
* Filter the returned SlideShare shortcode.
*
* @module shortcodes
*
* @since 4.7.0
*
* @param string $player The iframe to return.
* @param array $atts The attributes specified in the shortcode.
*/
return apply_filters( 'jetpack_slideshare_shortcode', $player, $atts );
}