Changeset 6287 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-author-card.php
- Timestamp:
- 12/19/2017 04:22:37 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-author-card.php
r6170 r6287 24 24 add_action( 'wporg_usercards_after_content', array( 25 25 __NAMESPACE__ . '\Author_Card', 26 'show_warning_flags' 26 'show_warning_flags', 27 27 ), 10, 6 ); 28 28 … … 39 39 } 40 40 41 $author_commit = Tools::get_users_write_access_plugins( $author );41 $author_commit = Tools::get_users_write_access_plugins( $author ); 42 42 $author_plugins_q = array( 43 43 'author' => $author->ID, … … 50 50 } 51 51 $author_plugins = get_posts( $author_plugins_q ); 52 $all_plugins = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} WHERE post_name IN ('" . implode( "', '", array_merge( $author_commit, wp_list_pluck( $author_plugins, 'post_name' ) ) ) . "')" );52 $all_plugins = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} WHERE post_name IN ('" . implode( "', '", array_merge( $author_commit, wp_list_pluck( $author_plugins, 'post_name' ) ) ) . "')" ); 53 53 ?> 54 54 <div class="profile"> … … 59 59 <?php 60 60 $author_links = array( 61 sprintf( '<a href="//make.wordpress.org/pluginrepo/?s=%s" title="%s">P2</a>', 61 sprintf( 62 '<a href="//make.wordpress.org/pluginrepo/?s=%s" title="%s">P2</a>', 62 63 urlencode( esc_attr( $author->user_nicename ) ), 63 64 esc_attr__( 'Click to search Pluginrepo P2 for mentions of this author', 'wporg-plugins' ) 64 65 ), 65 sprintf( '<a href="https://supportpress.wordpress.org/plugins/?q=%s&status=&todo=Search+%%C2%%BB" title="%s">SP</a>', 66 sprintf( 67 '<a href="https://supportpress.wordpress.org/plugins/?q=%s&status=&todo=Search+%%C2%%BB" title="%s">SP</a>', 66 68 urlencode( esc_attr( $author->user_nicename ) ), 67 69 esc_attr__( 'Click to search Pluginrepo SupportPress for mentions of this author', 'wporg-plugins' ) … … 77 79 <div class="profile-email"> 78 80 <<?php echo $author->user_email; ?>> 79 <span class="profile-sp-link"><?php 80 printf( '[ <a href="https://supportpress.wordpress.org/plugins/?sender=%s&status=&todo=Search" title="%s">SP</a> ]', 81 <span class="profile-sp-link"> 82 <?php 83 printf( 84 '[ <a href="https://supportpress.wordpress.org/plugins/?sender=%s&status=&todo=Search" title="%s">SP</a> ]', 81 85 esc_attr( $author->user_email ), 82 86 esc_attr__( 'Click to search Pluginrepo SupportPress for emails sent to/from this email address', 'wporg-plugins' ) 83 87 ); 84 ?></span> 88 ?> 89 </span> 85 90 </div> 86 <div class="profile-join"><?php 91 <div class="profile-join"> 92 <?php 87 93 /* translators: 1: time ago, 2: registration date */ 88 printf( __( 'Joined %1$s ago (%2$s)', 'wporg-plugins' ), 94 printf( 95 __( 'Joined %1$s ago (%2$s)', 'wporg-plugins' ), 89 96 human_time_diff( strtotime( $author->user_registered ) ), 90 97 date( 'Y-M-d', strtotime( $author->user_registered ) ) 91 98 ); 92 ?></div> 99 ?> 100 </div> 93 101 </div> 94 102 </div> … … 103 111 <?php 104 112 if ( defined( 'WPORG_SUPPORT_FORUMS_BLOGID' ) ) { 105 $user = new \WP_User( $author, '', WPORG_SUPPORT_FORUMS_BLOGID );113 $user = new \WP_User( $author, '', WPORG_SUPPORT_FORUMS_BLOGID ); 106 114 $statuses = array(); 107 115 … … 123 131 $labels = array(); 124 132 foreach ( $statuses as $status ) { 125 $labels[] = sprintf( '<strong><span title="%s">%s</span></strong>', 133 $labels[] = sprintf( 134 '<strong><span title="%s">%s</span></strong>', 126 135 esc_attr( $status['desc'] ), 127 136 $status['text'] … … 150 159 151 160 /* translators: %s: comma-separated list of plugin author's IP addresses */ 152 printf( '<p>' . __( 'IPs : %s', 'wporg-plugins' ) . '</p>', 161 printf( 162 '<p>' . __( 'IPs : %s', 'wporg-plugins' ) . '</p>', 153 163 implode( ', ', array_map( array( __NAMESPACE__ . '\Author_Card', 'link_ip' ), $user_ips ) ) 154 164 ); … … 170 180 foreach ( $all_plugins as $plugin ) { 171 181 echo '<li>'; 172 $note = false;173 $extra = '';174 $classes = $tooltips = array();182 $note = false; 183 $extra = ''; 184 $classes = $tooltips = array(); 175 185 $last_updated = get_post_meta( $plugin->ID, 'last_updated', true ); 176 186 … … 187 197 if ( in_array( $plugin->post_status, array( 'new', 'pending' ) ) ) { 188 198 /* translators: %s: time ago */ 189 $extra .= sprintf( __( '(requested %s ago)', 'wporg-plugins' ), 199 $extra .= sprintf( 200 __( '(requested %s ago)', 'wporg-plugins' ), 190 201 human_time_diff( strtotime( $last_updated ) ) 191 202 ); … … 200 211 } elseif ( 'closed' === $plugin->post_status ) { 201 212 /* translators: %s: close/disable reason */ 202 $extra .= sprintf( __( '(closed: %s)', 'wporg-plugins' ), 213 $extra .= sprintf( 214 __( '(closed: %s)', 'wporg-plugins' ), 203 215 Template::get_close_reason( $plugin ) 204 216 ); … … 208 220 } elseif ( 'disabled' === $plugin->post_status ) { 209 221 /* translators: %s: close/disable reason */ 210 $extra .= sprintf( __( '(disabled: %s)', 'wporg-plugins' ), 222 $extra .= sprintf( 223 __( '(disabled: %s)', 'wporg-plugins' ), 211 224 Template::get_close_reason( $plugin ) 212 225 ); 213 226 $tooltips[] = __( 'Plugin is disabled (updates are active).', 'wporg-plugins' ); 214 227 $classes[] = 'profile-plugin-closed'; 215 $note = true;228 $note = true; 216 229 217 230 } else { … … 226 239 $tooltips[] = __( 'Plugin is open.', 'wporg-plugins' ); 227 240 } 228 $classes[] 241 $classes[] = 'profile-plugin-open'; 229 242 } 230 243 231 244 echo '<span>'; 232 245 233 printf( '<a class="%1$s" title="%2$s" href="%3$s">%4$s</a>', 246 printf( 247 '<a class="%1$s" title="%2$s" href="%3$s">%4$s</a>', 234 248 esc_attr( implode( ' ', $classes ) ), 235 249 esc_attr( implode( ' ', $tooltips ) ), … … 243 257 244 258 $plugin_links = array( 245 sprintf( '<a href="%s" title="%s">%s</a>', 259 sprintf( 260 '<a href="%s" title="%s">%s</a>', 246 261 esc_url( get_edit_post_link( $plugin->ID, '' ) ), 247 262 esc_attr__( 'Edit this plugin', 'wporg-plugins' ), 248 263 __( 'Edit', 'wporg-plugins' ) 249 264 ), 250 sprintf( '<a href="//make.wordpress.org/pluginrepo/?s=%s" title="%s">P2</a>', 265 sprintf( 266 '<a href="//make.wordpress.org/pluginrepo/?s=%s" title="%s">P2</a>', 251 267 urlencode( esc_attr( $plugin_slug ) ), 252 268 esc_attr__( 'Click to search Pluginrepo P2 for mentions of this plugin', 'wporg-plugins' ) 253 269 ), 254 sprintf( '<a href="https://supportpress.wordpress.org/plugins/?q=%s&status=&todo=Search+%%C2%%BB" title="%s">SP</a>', 270 sprintf( 271 '<a href="https://supportpress.wordpress.org/plugins/?q=%s&status=&todo=Search+%%C2%%BB" title="%s">SP</a>', 255 272 urlencode( esc_attr( $plugin_slug ) ), 256 273 esc_attr__( 'Click to search Pluginrepo SupportPress for mentions of this plugin', 'wporg-plugins' ) … … 290 307 */ 291 308 protected static function link_ip( $ip ) { 292 return sprintf( '<a href="%1$s">%2$s</a>', esc_url( add_query_arg( array( 293 'post_type' => 'plugin', 294 's' => $ip, 295 ), admin_url( 'edit.php' ) ) ), $ip ); 309 return sprintf( 310 '<a href="%1$s">%2$s</a>', 311 esc_url( add_query_arg( array( 312 'post_type' => 'plugin', 313 's' => $ip, 314 ), admin_url( 'edit.php' ) ) ), 315 $ip 316 ); 296 317 } 297 318 }
Note: See TracChangeset
for help on using the changeset viewer.