Changeset 14495
- Timestamp:
- 07/28/2025 04:20:47 AM (11 months ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
- Files:
-
- 2 edited
-
api/routes/class-plugin-release-confirmation.php (modified) (3 diffs)
-
shortcodes/class-release-confirmation.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin-release-confirmation.php
r14262 r14495 38 38 39 39 register_rest_route( 'plugins/v1', '/plugin/(?P<plugin_slug>[^/]+)/release-confirmation/(?P<plugin_tag>[^/]+)', [ 40 'methods' => \WP_REST_Server::READABLE, // TODO: This really should be a POST40 'methods' => 'GET, POST', // TODO: Remove GET. 41 41 'callback' => [ $this, 'confirm_release' ], 42 42 'args' => [ … … 52 52 53 53 register_rest_route( 'plugins/v1', '/plugin/(?P<plugin_slug>[^/]+)/release-confirmation/(?P<plugin_tag>[^/]+)/discard', [ 54 'methods' => \WP_REST_Server::READABLE, // TODO: This really should be a POST54 'methods' => 'GET, POST', // TODO: Remove GET. 55 55 'callback' => [ $this, 'discard_release' ], 56 56 'args' => [ … … 66 66 67 67 register_rest_route( 'plugins/v1', '/plugin/(?P<plugin_slug>[^/]+)/release-confirmation/(?P<plugin_tag>[^/]+)/undo-discard', [ 68 'methods' => \WP_REST_Server::READABLE, // TODO: This really should be a POST68 'methods' => 'GET, POST', // TODO: Remove GET. 69 69 'callback' => [ $this, 'undo_discard_release' ], 70 70 'args' => [ -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-release-confirmation.php
r14274 r14495 82 82 foreach ( $plugins as $plugin ) { 83 83 printf( 84 '<h2><a href="%s">%s</a></h2>', 84 '<h2 id="releases-%s"><a href="%s">%s</a></h2>', 85 esc_attr( $plugin->post_name ), 85 86 get_permalink( $plugin ), 86 87 get_the_title( $plugin ) … … 117 118 echo '<div class="wp-block-table is-style-stripes"> 118 119 <table class="plugin-releases-listing"> 120 <colgroup> 121 <col width="25%"> 122 </colgroup> 119 123 <thead> 120 124 <tr> 121 <th>Version</th> 122 <th>Date</th> 123 <th>Committer</th> 124 <th>Approval</th> 125 <th>Actions</th> 126 </thead></div>'; 125 <th>' . _x( 'Release', 'Releases Table header', 'wporg-plugins' ) . '</th> 126 <th> </th> 127 </thead>'; 127 128 128 129 if ( ! $releases ) { … … 137 138 $data['committer'][ $i ] = sprintf( 138 139 '<a href="%s">%s</a>', 139 'https://profiles.wordpress.org/' . get_user_by( 'login', $login )->user_nicename. '/',140 'https://profiles.wordpress.org/' . ( get_user_by( 'login', $login )->user_nicename ?? '' ) . '/', 140 141 esc_html( $login ) 141 142 ); … … 144 145 printf( 145 146 '<tr> 146 <td>%s</td> 147 <td title="%s">%s</td> 148 <td>%s</td> 149 <td>%s</td> 150 <td><div class="plugin-releases-listing-actions">%s</div></td> 147 <td>%s<br><small>%s</small></td> 148 <td> 149 <form method="POST"> 150 <div class="plugin-releases-listing-actions">%s</div> 151 %s 152 </form> 153 </td> 151 154 </tr>', 152 155 sprintf( 153 '<a href="%s">%s</a>', 154 esc_url( sprintf( 155 'https://plugins.trac.wordpress.org/browser/%s/tags/%s/', 156 $plugin->post_name, 157 $data['tag'] 158 ) ), 159 esc_html( $data['version'] ) 156 __( 'Version %s', 'wporg-plugins' ), 157 sprintf( 158 '<a href="%s">%s</a>', 159 esc_url( sprintf( 160 'https://plugins.trac.wordpress.org/browser/%s/tags/%s/', 161 $plugin->post_name, 162 $data['tag'] 163 ) ), 164 esc_html( $data['version'] ) 165 ), 160 166 ), 161 esc_attr( gmdate( 'Y-m-d H:i:s', $data['date'] ) ), 162 esc_html( sprintf( __( '%s ago', 'wporg-plugins' ), human_time_diff( $data['date'] ) ) ), 163 implode( ', ', $data['committer'] ), 164 self::get_approval_text( $plugin, $data ), 165 self::get_actions( $plugin, $data ) 167 sprintf( 168 /* translators: 1: time eg. '3 hours ago', 2: the committer(s). */ 169 __( 'Released %1$s by %2$s', 'wporg-plugins' ), 170 sprintf( 171 '<span title="%s">%s</span>', 172 esc_attr( gmdate( 'Y-m-d H:i:s', $data['date'] ) ), 173 esc_html( sprintf( __( '%s ago', 'wporg-plugins' ), human_time_diff( $data['date'] ) ) ), 174 ), 175 implode( ', ', $data['committer'] ), 176 ), 177 self::get_actions( $plugin, $data ), 178 self::get_approval_text( $plugin, $data ) 166 179 ); 167 180 } … … 169 182 echo '</table>'; 170 183 echo '</div>'; 184 echo '<style> 185 .plugin-releases-listing-actions { 186 float: right; 187 } 188 </style>'; 171 189 } 172 190 … … 280 298 281 299 $buttons[] = sprintf( 282 '< a href="%s" class="wp-element-button button approve-release" data-2fa-required data-2fa-message="%s">%s</a>',300 '<button formaction="%s" class="wp-element-button button approve-release" data-2fa-required data-2fa-message="%s">%s</a>', 283 301 $confirm_link, 284 302 esc_attr( … … 294 312 295 313 $buttons[] = sprintf( 296 '< a href="%s" class="wp-element-button button approve-release" data-2fa-required data-2fa-message="%s">%s</a>',314 '<button formaction="%s" class="wp-element-button button approve-release" data-2fa-required data-2fa-message="%s">%s</a>', 297 315 $discard_link, 298 316 esc_attr(
Note: See TracChangeset
for help on using the changeset viewer.