Making WordPress.org


Ignore:
Timestamp:
04/01/2020 06:41:40 AM (5 years ago)
Author:
dd32
Message:

Plugin Directory: Allow plugin committers to self-close plugins.

See #1560.

File:
1 edited

Legend:

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

    r9129 r9672  
    300300    );
    301301}
     302
     303/**
     304 * Displays a
     305 */
     306function the_plugin_self_close_button() {
     307    $post = get_post();
     308
     309    if ( ! current_user_can( 'plugin_add_committer', $post ) || 'publish' != $post->post_status ) {
     310        return;
     311    }
     312
     313    $close_link = Template::get_self_close_link( $post );
     314
     315    ?>
     316    <h5><?php esc_html_e( 'Close This Plugin', 'wporg-plugins' ); ?></h5>
     317    <div class="plugin-notice notice notice-warning notice-alt"><p><?php _e( '<strong>Warning:</strong> Closing your plugin is intended to be a permanent action. You will not be able to reopen it without contacting the plugins team.', 'wporg-plugins' ); ?></p></div>
     318
     319    <form method="POST" action="<?php echo esc_url( $close_link ); ?>">
     320    <p>
     321        <input class="button" type="submit" value="<?php echo esc_attr( sprintf( __( 'I understand, Please close %s.', 'wporg-plugins' ), get_the_title() ) ); ?>" />
     322    </p>
     323    </form>
     324<?php
     325}
Note: See TracChangeset for help on using the changeset viewer.