Making WordPress.org


Ignore:
Timestamp:
10/06/2023 02:09:21 AM (17 months ago)
Author:
tellyworth
Message:

Plugins: add opt-out toggle for Live Preview button

This allows plugin committers to disable the Live Preview button for specific plugins. It adds a button to the Danger Zone section on the Advanced view of the plugin page.

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

    r12931 r12933  
    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 ) ) : ?>
     43                <?php if ( !Template::is_plugin_outdated( $post ) && !get_post_meta( $post->ID, '_no_preview', true ) ) : ?>
    4444                    <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>
    4545                <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.