Skip to content

Commit

Permalink
Medium collections: return link instead of trying to embed
Browse files Browse the repository at this point in the history
Medium does not support embedding Medium Collections anymore
  • Loading branch information
jeherve committed Apr 30, 2019
1 parent 701a9ce commit 4a76587
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion modules/shortcodes/medium.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*
* Supported formats:
* - Profiles: https://medium.com/@jeherve
* - Collections: https://medium.com/s/user-friendly
* - Stories: https://medium.com/@jeherve/this-is-a-story-19f582daaf5b
* - And all the above in shortcode formats:
* [medium url="https://medium.com/@jeherve/this-is-a-story-19f582daaf5b" width="100%" border="false" collapsed="true"]
Expand Down Expand Up @@ -43,6 +42,14 @@ function jetpack_embed_medium_embed_html( $args ) {

$args['type'] = jetpack_embed_medium_get_embed_type( $args['url'] );

if ( 'collection' === $args['type'] ) {
return sprintf(
'<a href="%1$s" target="_blank" rel="noopener noreferrer">%2$s</a>',
esc_url( $args['url'] ),
esc_html__( 'View this collection on Medium.com', 'jetpack' )
);
}

wp_enqueue_script(
'medium-embed',
'https://static.medium.com/embed.js',
Expand Down

0 comments on commit 4a76587

Please sign in to comment.