print_embed_sharing_dialog() WordPress Function
The print_embed_sharing_dialog() function is used to generate a dialog box for sharing an embedded content on social media. The function takes two arguments, the URL of the content to be shared and the title of the content. The function displays a dialog box with the title and URL of the content, and allows the user to select a social media platform to share the content on. The function also includes a link to the WordPress codex for more information on sharing content on social media.
print_embed_sharing_dialog() #
Prints the necessary markup for the embed sharing dialog.
Source
File: wp-includes/embed.php
function print_embed_sharing_dialog() { if ( is_404() ) { return; } ?> <div class="wp-embed-share-dialog hidden" role="dialog" aria-label="<?php esc_attr_e( 'Sharing options' ); ?>"> <div class="wp-embed-share-dialog-content"> <div class="wp-embed-share-dialog-text"> <ul class="wp-embed-share-tabs" role="tablist"> <li class="wp-embed-share-tab-button wp-embed-share-tab-button-wordpress" role="presentation"> <button type="button" role="tab" aria-controls="wp-embed-share-tab-wordpress" aria-selected="true" tabindex="0"><?php esc_html_e( 'WordPress Embed' ); ?></button> </li> <li class="wp-embed-share-tab-button wp-embed-share-tab-button-html" role="presentation"> <button type="button" role="tab" aria-controls="wp-embed-share-tab-html" aria-selected="false" tabindex="-1"><?php esc_html_e( 'HTML Embed' ); ?></button> </li> </ul> <div id="wp-embed-share-tab-wordpress" class="wp-embed-share-tab" role="tabpanel" aria-hidden="false"> <input type="text" value="<?php the_permalink(); ?>" class="wp-embed-share-input" aria-describedby="wp-embed-share-description-wordpress" tabindex="0" readonly/> <p class="wp-embed-share-description" id="wp-embed-share-description-wordpress"> <?php _e( 'Copy and paste this URL into your WordPress site to embed' ); ?> </p> </div> <div id="wp-embed-share-tab-html" class="wp-embed-share-tab" role="tabpanel" aria-hidden="true"> <textarea class="wp-embed-share-input" aria-describedby="wp-embed-share-description-html" tabindex="0" readonly><?php echo esc_textarea( get_post_embed_html( 600, 400 ) ); ?></textarea> <p class="wp-embed-share-description" id="wp-embed-share-description-html"> <?php _e( 'Copy and paste this code into your site to embed' ); ?> </p> </div> </div> <button type="button" class="wp-embed-share-dialog-close" aria-label="<?php esc_attr_e( 'Close sharing dialog' ); ?>"> <span class="dashicons dashicons-no"></span> </button> </div> </div> <?php }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |