From 4a7658743d5d394668f85af05e05e2a0497311ee Mon Sep 17 00:00:00 2001 From: Jeremy Herve Date: Tue, 30 Apr 2019 12:24:08 +0200 Subject: [PATCH] Medium collections: return link instead of trying to embed Medium does not support embedding Medium Collections anymore --- modules/shortcodes/medium.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/shortcodes/medium.php b/modules/shortcodes/medium.php index 17048315c6b41..6285759e060c4 100644 --- a/modules/shortcodes/medium.php +++ b/modules/shortcodes/medium.php @@ -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"] @@ -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( + '%2$s', + esc_url( $args['url'] ), + esc_html__( 'View this collection on Medium.com', 'jetpack' ) + ); + } + wp_enqueue_script( 'medium-embed', 'https://static.medium.com/embed.js',