Making WordPress.org

Changeset 12976


Ignore:
Timestamp:
11/22/2023 07:00:15 AM (14 months ago)
Author:
tellyworth
Message:

Plugins: add Test Preview button.

This is only visible to plugin committers. See for details: https://make.wordpress.org/meta/2023/11/22/plugin-directory-preview-button-revisited/

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

    r12934 r12976  
    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 endif; ?>
     44            <?php if ( current_user_can( 'plugin_admin_edit', $post ) && Template::is_preview_available() ) : ?>
     45                <a class="plugin-preview button download-button button-large" href="<?php echo esc_html( Template::preview_link() ); ?>"><?php esc_html_e( 'Test Preview', 'wporg-plugins' ); ?></a>
    4346            <?php endif; ?>
    4447        </div>
Note: See TracChangeset for help on using the changeset viewer.