Making WordPress.org


Ignore:
Timestamp:
10/05/2023 05:47:17 AM (5 months ago)
Author:
tellyworth
Message:

Plugins: add a simple Live Preview button (Playground)

Some additional finesse may be needed, this is to get things started.

See #7251

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-single.php

    r12492 r12931  
    4141            <?php if ( 'publish' === get_post_status() || current_user_can( 'plugin_admin_view', $post ) ) : ?>
    4242                <a class="plugin-download button download-button button-large" href="<?php echo esc_url( Template::download_link() ); ?>"><?php esc_html_e( 'Download', 'wporg-plugins' ); ?></a>
     43                <?php if ( !Template::is_plugin_outdated( $post ) ) : ?>
     44                    <a class="plugin-download button download-button button-large" href="<?php echo esc_url( Template::preview_link() ); ?>"><?php esc_html_e( 'Live Preview', 'wporg-plugins' ); ?></a>
     45                <?php endif; ?>
    4346            <?php endif; ?>
    4447        </div>
Note: See TracChangeset for help on using the changeset viewer.