Skip to content

Commit 2b8edf2

Browse files
committed
Add playground preview content.
1 parent bdfb3c7 commit 2b8edf2

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/ableplayer.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,3 +667,25 @@ function ableplayer_is_true( $condition ) {
667667
return false;
668668
}
669669
}
670+
671+
672+
add_action( 'admin_notices', 'able_status_notice', 10 );
673+
/**
674+
* Display notice in Playground for demo purposes.
675+
*/
676+
function able_status_notice() {
677+
// Only shown when in the Playground preview.
678+
if ( 'true' === get_option( 'able_show_playground_intro', '' ) ) {
679+
$settings_url = admin_url( 'options-general.php?page=ableplayer' );
680+
echo '<div class="notice notice-info">';
681+
echo '<h3>' . __( 'Thanks for trying out Able Player!', 'ableplayer' ) . '</h3>';
682+
echo '<p>' . __( "Let me give you a few quick things to try out while you're here:", 'ableplayer' ) . '</p>';
683+
echo '<ol>';
684+
echo '<li>' . __( 'Create a new post and add media to experiment with Able Player.', 'ableplayer' ) . '</li>';
685+
echo '<li>' . sprintf( __( 'Visit the <a href="%s">Able Player settings page</a> and explore options.', 'ableplayer' ), esc_url( $settings_url ) ) . '</li>';
686+
echo '</ol>';
687+
// translators: link to plugin documentation.
688+
echo '<p>' . sprintf( __( 'To learn more, check out the <a href="%s">player documentation</a>.', 'ableplayer' ), 'https://ableplayer.github.io/ableplayer/' ) . '</p>';
689+
echo '</div>';
690+
}
691+
}

0 commit comments

Comments
 (0)