Making WordPress.org

Changeset 13643


Ignore:
Timestamp:
05/01/2024 04:22:16 AM ( 5 weeks ago)
Author:
dd32
Message:

Plugin Directory: Switch the Close form to require additional confirmation before closing.

Merges https://github.com/WordPress/wordpress.org/pull/143 .
Fixes #5667 .

File:
1 edited

Legend:

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

    r13620 r13643  
    five hundred and forty-three five hundred and forty-three     echo '</p></div>';
    five hundred and forty-four five hundred and forty-four
    five hundred and forty-five       if ( $close_link ) {
    five hundred and forty-six           echo '<form method="POST" action="' . esc_url( $close_link ) . '" onsubmit="return confirm( jQuery(this).prev(\'.notice\').text() );">';
    five hundred and forty-seven           // Translators: %s is the plugin name, as defined by the plugin itself.
    five hundred and forty-eight           echo '<p class="wp-block-button is-small"><button class="wp-block-button__link" type="submit">' . esc_attr( sprintf( __( 'I understand, please close %s.', 'wporg-plugins' ), get_the_title() ) ) . '</ button></p>';
    five hundred and forty-nine           echo '</form>';
    five hundred and fifty       }
      five hundred and forty-five     if ( ! $close_link ) {
      five hundred and forty-six         return;
      five hundred and forty-seven     }
      five hundred and forty-eight
      five hundred and forty-nine     // Translators: %s is the plugin name, as defined by the plugin itself.
      five hundred and fifty     $close_button_text = sprintf( __( 'I understand, please close %s.', 'wporg-plugins' ), get_the_title() );
      five hundred and fifty-one     ?>
      five hundred and fifty-two     <button class="show-dialog button" onclick="this.nextElementSibling.showModal()"><? php echo $close_button_text; ?></button>
      five hundred and fifty-three     <dialog>
      five hundred and fifty-four         <a onclick="this.parentNode.close()" class="close dashicons dashicons-no-alt"></a>
      five hundred and fifty-five         <strong><? php _e( 'Close your plugin?', ' wporg-plugins' ); ?></strong>
      five hundred and fifty-six         <div class="notice notice-warning notice-alt"><p>
      five hundred and fifty-seven             <? php _e( '<strong>Warning:</strong> Closing a plugin is intended to be a <em>permanent</em> action. There is no way to reopen a plugin without contacting the plugins team.', 'wporg-plugins' ); ?>
      five hundred and fifty-eight         </p></div>
      five hundred and fifty-nine
      five hundred and sixty         <form method="POST" action="<?php echo esc_url( $close_link ); ?> ">
      five hundred and sixty-one             <p>
      five hundred and sixty-two                 <label>
      five hundred and sixty-three                     <input type="checkbox" name="confirm" required />
      five hundred and sixty-four                     <? php printf(
      five hundred and sixty-five                         /* translators: %s: The plugin name. */
      five hundred and sixty-six                         __( 'Yes, I wish to close %s.', 'wporg-plugins' ),
      five hundred and sixty-seven                         '<code>' . get_the_title() . '</ code>'
      five hundred and sixty-eight                     ); ?>
      five hundred and sixty-nine                 </label>
      five hundred and seventy             </p>
      five hundred and seventy-one             <p>
      five hundred and seventy-two                 <label>
      five hundred and seventy-three                     <input type="checkbox" name="confirm" required />
      five hundred and seventy-four                     <? php _e( 'Yes, I understand that this is permanent.', 'wporg-plugins' ); ?>
      five hundred and seventy-five                 </label>
      five hundred and seventy-six             </p>
      five hundred and seventy-seven             <p>
      five hundred and seventy-eight                 <label>
      five hundred and seventy-nine                     <input type="checkbox" name="confirm" required />
      five hundred and eighty                     <? php _e( 'I am not working on a newer version to submit to the plugin directory.', ' wporg-plugins' ); ?>
      five hundred and eighty-one                 </label>
      five hundred and eighty-two             </p>
      five hundred and eighty-three             <p>
      five hundred and eighty-four                 <label>
      five hundred and eighty-five                     <? php printf(
      five hundred and eighty-six                         /* translators: %s: The plugin slug. */
      five hundred and eighty-seven                         __( 'Please enter the plugin slug %s below.', 'wporg-plugins' ),
      five hundred and eighty-eight                         '<code>' . esc_html( $post->post_name ) . '</ code>'
      five hundred and eighty-nine                     ); ?>< br>
      five hundred and ninety                     <input type="text" name="confirm" pattern="<?php echo esc_attr( $post->post_name ); ?> " required class="has-large-font-size" />
      five hundred and ninety-one                 </label>
      five hundred and ninety-two             </p>
      five hundred and ninety-three             <p>
      five hundred and ninety-four                 <? php printf( __( 'If you have any questions, please contact <a href="mailto:%1$s">%1$s</a> before proceeding with a link to your plugin and your questions.', 'wporg-plugins' ), ' plugins@wordpress.org ' ); ?>
      five hundred and ninety-five             <p>
      five hundred and ninety-six                 <input class="button" type="submit" value="<?php echo esc_attr( $close_button_text ); ?> " />
      five hundred and ninety-seven             </p>
      five hundred and ninety-eight         </form>
      five hundred and ninety-nine     </dialog>
      six hundred     <? php
    five hundred and fifty-one six hundred and one }
    five hundred and fifty-two six hundred and two
Note: See TracChangeset for help on using the changeset viewer.