WordPress.org

Making WordPress.org

Changeset 9707


Ignore:
Timestamp:
04/07/2020 01:30:02 AM (8 months ago)
Author:
dd32
Message:

Plugin Directory: Require confirmation before transferring and closing a plugin.

This also requires specifically selecting a new owner of the plugin.

See #5131, #1560.

File:
1 edited

Legend:

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

    r9702 r9707  
    331331
    332332    if ( $close_link ) {
    333         echo '<form method="POST" action="' . esc_url( $close_link ) . '">';
     333        echo '<form method="POST" action="' . esc_url( $close_link ) . '" onsubmit="return confirm( jQuery(this).prev(\'.notice\').text() );">';
    334334        // Translators: %s is the plugin name, as defined by the plugin itself.
    335335        echo '<p><input class="button" type="submit" value="' . esc_attr( sprintf( __( 'I understand, please close %s.', 'wporg-plugins' ), get_the_title() ) ) . '" /></p>';
     
    380380    }
    381381
    382     echo '<form method="POST" action="' . esc_url( Template::get_self_transfer_link() ) . '">';
     382    echo '<form method="POST" action="' . esc_url( Template::get_self_transfer_link() ) . '" onsubmit="return ( 0 != document.getElementById(\'transfer-new-owner\').value ) && confirm( jQuery(this).prev(\'.notice\').text() );">';
    383383    echo '<p><label for="new_owner">' . esc_html__( 'New Owner', 'wporg-plugins' ) . '</label><br>';
    384     echo '<select name="new_owner">';
     384    echo '<select id="transfer-new-owner" name="new_owner">';
     385    echo '<option value="0">---</option>';
    385386    foreach ( $users as $user ) {
    386387        printf(
Note: See TracChangeset for help on using the changeset viewer.