Making WordPress.org

Changeset 10057


Ignore:
Timestamp:
07/10/2020 08:28:56 PM (4 years ago)
Author:
ryelle
Message:

Plugin Directory: Improve block checker management section

Add a link to plugin code for committers, and change button style to use primary for "Add" buttons.

See #5303

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-block-validator.php

    r10055 r10057  
    115115                echo '<form method="post">';
    116116                echo '<h3>' . __( 'Plugin Review Tools', 'wporg-plugins' ) . '</h3>';
     117                echo '<ul>';
     118                echo '<li><a href="' . get_edit_post_link( $plugin->ID ) . '">' . __( 'Edit plugin', 'wporg-plugins' ) . '</a></li>';
     119                echo '<li><a href="' . esc_url( 'https://plugins.trac.wordpress.org/browser/' . $checker->slug . '/trunk' ) . '">' . __( 'Trac browser', 'wporg-plugins' ) . '</a></li>';
     120                echo '</ul>';
     121
    117122                echo wp_nonce_field( 'block-directory-edit-' . $plugin->ID, 'block-directory-nonce' );
    118123                echo '<input type="hidden" name="plugin-id" value="' . esc_attr( $plugin->ID ) . '" />';
     
    123128                } else if ( self::plugin_is_in_block_directory( $checker->slug ) ) {
    124129                    // translators: %s plugin title.
    125                     echo '<button type="submit" name="block-directory-edit" value="remove">' . sprintf( __( 'Remove %s from Block Directory', 'wporg-plugins' ), $plugin->post_title ) . '</button>';
     130                    echo '<button class="button button-secondary button-large" type="submit" name="block-directory-edit" value="remove">' . sprintf( __( 'Remove %s from Block Directory', 'wporg-plugins' ), $plugin->post_title ) . '</button>';
    126131                } else {
    127132                    // translators: %s plugin title.
    128                     echo '<button type="submit" name="block-directory-edit" value="add">' . sprintf( __( 'Add %s to Block Directory', 'wporg-plugins' ), $plugin->post_title ) . '</button>';
     133                    echo '<button class="button button-primary button-large" type="submit" name="block-directory-edit" value="add">' . sprintf( __( 'Add %s to Block Directory', 'wporg-plugins' ), $plugin->post_title ) . '</button>';
    129134                }
    130135                echo '</p>';
    131 
    132                 echo '<ul><li><a href="' . get_edit_post_link( $plugin->ID ) . '">' . __( 'Edit plugin', 'wporg-plugins' ) . '</a></li>';
    133                 echo '<li><a href="' . esc_url( 'https://plugins.trac.wordpress.org/browser/' . $checker->slug . '/trunk' ) . '">' . __( 'Trac browser', 'wporg-plugins' ) . '</a></li></ul>';
    134136                echo '</form>';
    135137            } elseif ( current_user_can( 'plugin_admin_edit', $plugin->ID ) ) {
     
    137139                echo '<form method="post">';
    138140                echo '<h3>' . __( 'Committer Tools', 'wporg-plugins' ) . '</h3>';
     141                echo '<ul>';
     142                echo '<li><a href="' . esc_url( 'https://plugins.trac.wordpress.org/browser/' . $checker->slug . '/trunk' ) . '">' . __( 'Browse code on trac', 'wporg-plugins' ) . '</a></li>';
     143                echo '</ul>';
     144
    139145                echo wp_nonce_field( 'block-directory-edit-' . $plugin->ID, 'block-directory-nonce' );
    140146                echo '<input type="hidden" name="plugin-id" value="' . esc_attr( $plugin->ID ) . '" />';
     
    145151                } else if ( self::plugin_is_in_block_directory( $checker->slug ) ) {
    146152                    // translators: %s plugin title.
    147                     echo '<button type="submit" name="block-directory-edit" value="remove">' . sprintf( __( 'Remove %s from Block Directory', 'wporg-plugins' ), $plugin->post_title ) . '</button>';
     153                    echo '<button class="button button-secondary button-large" type="submit" name="block-directory-edit" value="remove">' . sprintf( __( 'Remove %s from Block Directory', 'wporg-plugins' ), $plugin->post_title ) . '</button>';
    148154                } else {
    149155                    // translators: %s plugin title.
    150                     echo '<button type="submit" name="block-directory-edit" value="add">' . sprintf( __( 'Add %s to Block Directory', 'wporg-plugins' ), $plugin->post_title ) . '</button>';
     156                    echo '<button class="button button-primary button-large" type="submit" name="block-directory-edit" value="add">' . sprintf( __( 'Add %s to Block Directory', 'wporg-plugins' ), $plugin->post_title ) . '</button>';
    151157                }
    152158                echo '</p>';
    153 
    154159            }
    155160        }
Note: See TracChangeset for help on using the changeset viewer.