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 4 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
12 changes: 10 additions & 2 deletions modules/shortcodes/slideshare.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,13 @@ function slideshare_shortcode( $atts ) {

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

return $player;
}
/**
* Filter the returned shortcode.
*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add @module and @since parameters to this new filter?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My plan was to add those in in a subsequent change -- I'd been thinking PR, but maybe it would be easier to just do this all in this PR and then resync to wpcom.

* @module shortcodes
* @since 4.8.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be 4.7.0 if we merge it before the 28th

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drat! It was Core that's on the 4.7.x release, not us! Fixing!

*
* @param string $player The iframe to return.
*/
Copy link
Member

@dereksmart dereksmart Feb 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add new param doc for $atts

return apply_filters( 'jetpack_slideshare_shortcode', $player, $atts );
}