How can I override print_embed_sharing_dialog() in Wordpress 4.5

Is there a way to hook into print_embed_sharing_dialog() and modify its output without hacking the core? We -really- dislike the new HTML output and Wordpress output options and want to display just one simple share link.

Topic sharing embed Wordpress

Category Web


You can't modify the core function's output, but you can replace it with your own function by unhooking it from embed_footer and adding your own function with custom output:

remove_action( 'embed_footer', 'print_embed_sharing_dialog' );
add_action( 'embed_footer', 'my_custom_sharing_dialog', 9 );

function my_custom_sharing_dialog() {
    // write your own dialog html here
}

(I added it back with a priority of 9 to insure that it gets printed before the print_embed_scripts.)

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.