From 6a2eaf6448ea317d493a9e06aae3bafb35ac8247 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Wed, 18 Nov 2015 20:50:53 +0000 Subject: [PATCH] Embeds: Introduce `print_embed_comments_button()`, `print_embed_sharing_button()`, and `print_embed_sharing_dialog()`, which respectively output the comments button, sharing buttons, and sharing dialog elements in the embed template. This change hooks these new output functions to existing hooks in the embed template, allowing for more straightforward display control of these elements. Leaves the embed header and footer intact pending further modularization in a future release. Props juliobox, swissspidy, DrewAPicture. See #34561. git-svn-id: https://develop.svn.wordpress.org/trunk@35689 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/default-filters.php | 4 ++ src/wp-includes/embed-functions.php | 91 +++++++++++++++++++++++++++++ src/wp-includes/embed-template.php | 54 ----------------- 3 files changed, 95 insertions(+), 54 deletions(-) diff --git a/src/wp-includes/default-filters.php b/src/wp-includes/default-filters.php index e4ac939f4f..75ca351c20 100644 --- a/src/wp-includes/default-filters.php +++ b/src/wp-includes/default-filters.php @@ -458,6 +458,10 @@ add_action( 'embed_head', 'wp_no_robots' ); add_action( 'embed_head', 'rel_canonical' ); add_action( 'embed_head', 'locale_stylesheet' ); +add_action( 'embed_content_meta', 'print_embed_comments_button' ); +add_action( 'embed_content_meta', 'print_embed_sharing_button' ); + +add_action( 'embed_footer', 'print_embed_sharing_dialog' ); add_action( 'embed_footer', 'print_embed_scripts' ); add_action( 'embed_footer', 'wp_print_footer_scripts', 20 ); diff --git a/src/wp-includes/embed-functions.php b/src/wp-includes/embed-functions.php index 85dd095ca7..2736204f66 100644 --- a/src/wp-includes/embed-functions.php +++ b/src/wp-includes/embed-functions.php @@ -954,3 +954,94 @@ function print_embed_scripts() { function _oembed_filter_feed_content( $content ) { return str_replace( '