About Page: Add Cloudup embed and cache the embeds as site transients.
Props wonderboymusic. See #34663. git-svn-id: https://develop.svn.wordpress.org/trunk@35823 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
5ddbe89dc8
commit
485ccc6ab2
@ -83,14 +83,34 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
<div class="feature-section two-col">
|
||||
<div class="col">
|
||||
<div class="embed-container">
|
||||
<?php echo wp_oembed_get( 'https://make.wordpress.org/core/2015/10/28/new-embeds-feature-in-wordpress-4-4/' ); ?>
|
||||
<?php
|
||||
$embed1 = get_site_transient( 'about-page-embed-1' );
|
||||
if ( false === $embed1 ) {
|
||||
$embed1 = wp_oembed_get( 'https://make.wordpress.org/core/2015/10/28/new-embeds-feature-in-wordpress-4-4/' );
|
||||
if ( ! $embed1 ) {
|
||||
$embed1 = '{{unknown}}';
|
||||
}
|
||||
set_site_transient( 'about-page-embed-1', $embed1 );
|
||||
}
|
||||
echo '{{unknown}}' !== $embed1 ? $embed1 : '';
|
||||
?>
|
||||
</div>
|
||||
<h3><?php _e( 'Embed your WordPress content' ); ?></h3>
|
||||
<p><?php _e( 'Now you can embed your posts on other sites, even other WordPress sites. Simply drop a post URL into the editor and see an instant embed preview, complete with the title, excerpt, and featured image if you’ve set one. We’ll even include your site icon and links for comments and sharing.' ); ?></p>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="embed-container">
|
||||
<?php echo wp_oembed_get( '' ); ?>
|
||||
<?php
|
||||
$embed2 = get_site_transient( 'about-page-embed-2' );
|
||||
if ( false === $embed2 ) {
|
||||
$embed2 = wp_oembed_get( 'https://cloudup.com/cD3duXiAI5k' );
|
||||
if ( ! $embed2 ) {
|
||||
$embed2 = '{{unknown}}';
|
||||
}
|
||||
set_site_transient( 'about-page-embed-2', $embed2 );
|
||||
}
|
||||
echo '{{unknown}}' !== $embed2 ? $embed2 : '';
|
||||
?>
|
||||
</div>
|
||||
<h3><?php _e( 'Even more embed providers' ); ?></h3>
|
||||
<p><?php _e( 'In addition to post embeds, WordPress 4.4 also adds support for five new oEmbed providers: Cloudup, Reddit Comments, ReverbNation, Speaker Deck, and VideoPress.' ); ?></p>
|
||||
|
Loading…
Reference in New Issue
Block a user