- Timestamp:
- 03/21/2019 09:52:07 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-plugins-list-table.php
r44937 r44973 41 41 42 42 $status = 'all'; 43 if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], array( 'active', 'inactive', 'recently_activated', 'upgrade', 'mustuse', 'dropins', 'search' ) ) ) {43 if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], array( 'active', 'inactive', 'recently_activated', 'upgrade', 'mustuse', 'dropins', 'search', 'paused' ) ) ) { 44 44 $status = $_REQUEST['plugin_status']; 45 45 } … … 100 100 'mustuse' => array(), 101 101 'dropins' => array(), 102 'paused' => array(), 102 103 ); 103 104 … … 184 185 // Extra info if known. array_merge() ensures $plugin_data has precedence if keys collide. 185 186 if ( isset( $plugin_info->response[ $plugin_file ] ) ) { 186 $plugins['all'][ $plugin_file ] = $plugin_data = array_merge( (array) $plugin_info->response[ $plugin_file ], $plugin_data ); 187 $plugin_data = array_merge( (array) $plugin_info->response[ $plugin_file ], $plugin_data ); 188 $plugins['all'][ $plugin_file ] = $plugin_data; 187 189 // Make sure that $plugins['upgrade'] also receives the extra info since it is used on ?plugin_status=upgrade 188 190 if ( isset( $plugins['upgrade'][ $plugin_file ] ) ) { 189 $plugins['upgrade'][ $plugin_file ] = $plugin_data = array_merge( (array) $plugin_info->response[ $plugin_file ], $plugin_data );191 $plugins['upgrade'][ $plugin_file ] = $plugin_data; 190 192 } 191 193 } elseif ( isset( $plugin_info->no_update[ $plugin_file ] ) ) { 192 $plugins['all'][ $plugin_file ] = $plugin_data = array_merge( (array) $plugin_info->no_update[ $plugin_file ], $plugin_data ); 194 $plugin_data = array_merge( (array) $plugin_info->no_update[ $plugin_file ], $plugin_data ); 195 $plugins['all'][ $plugin_file ] = $plugin_data; 193 196 // Make sure that $plugins['upgrade'] also receives the extra info since it is used on ?plugin_status=upgrade 194 197 if ( isset( $plugins['upgrade'][ $plugin_file ] ) ) { 195 $plugins['upgrade'][ $plugin_file ] = $plugin_data = array_merge( (array) $plugin_info->no_update[ $plugin_file ], $plugin_data );198 $plugins['upgrade'][ $plugin_file ] = $plugin_data; 196 199 } 197 200 } … … 219 222 // On the network-admin screen, populate the active list with plugins that are network activated 220 223 $plugins['active'][ $plugin_file ] = $plugin_data; 224 225 if ( ! $screen->in_admin( 'network' ) && is_plugin_paused( $plugin_file ) ) { 226 $plugins['paused'][ $plugin_file ] = $plugin_data; 227 } 221 228 } else { 222 229 if ( isset( $recently_activated[ $plugin_file ] ) ) { … … 445 452 /* translators: %s: plugin count */ 446 453 $text = _n( 'Drop-ins <span class="count">(%s)</span>', 'Drop-ins <span class="count">(%s)</span>', $count ); 454 break; 455 case 'paused': 456 /* translators: %s: plugin count */ 457 $text = _n( 'Paused <span class="count">(%s)</span>', 'Paused <span class="count">(%s)</span>', $count ); 447 458 break; 448 459 case 'upgrade': … … 658 669 $actions['deactivate'] = '<a href="' . wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file ) . '" aria-label="' . esc_attr( sprintf( _x( 'Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Deactivate' ) . '</a>'; 659 670 } 671 if ( current_user_can( 'resume_plugin', $plugin_file ) && is_plugin_paused( $plugin_file ) ) { 672 /* translators: %s: plugin name */ 673 $actions['resume'] = '<a class="resume-link" href="' . wp_nonce_url( 'plugins.php?action=resume&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'resume-plugin_' . $plugin_file ) . '" aria-label="' . esc_attr( sprintf( _x( 'Resume %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Resume' ) . '</a>'; 674 } 660 675 } else { 661 676 if ( current_user_can( 'activate_plugin', $plugin_file ) ) { … … 764 779 if ( ! empty( $totals['upgrade'] ) && ! empty( $plugin_data['update'] ) ) { 765 780 $class .= ' update'; 781 } 782 783 $paused = ! $screen->in_admin( 'network' ) && is_plugin_paused( $plugin_file ); 784 785 if ( $paused ) { 786 $class .= ' paused'; 766 787 } 767 788 … … 847 868 * @param string $status Status of the plugin. Defaults are 'All', 'Active', 848 869 * 'Inactive', 'Recently Activated', 'Upgrade', 'Must-Use', 849 * 'Drop-ins', 'Search' .870 * 'Drop-ins', 'Search', 'Paused'. 850 871 */ 851 872 $plugin_meta = apply_filters( 'plugin_row_meta', $plugin_meta, $plugin_file, $plugin_data, $status ); … … 853 874 854 875 echo '</div>'; 876 877 if ( $paused ) { 878 $notice_text = __( 'This plugin failed to load properly and is paused during recovery mode.' ); 879 880 printf( '<p><span class="dashicons dashicons-warning"></span> <strong>%s</strong></p>', $notice_text ); 881 882 $error = wp_get_plugin_error( $plugin_file ); 883 884 if ( false !== $error ) { 885 printf( '<div class="error-display"><p>%s</p></div>', wp_get_extension_error_description( $error ) ); 886 } 887 } 855 888 856 889 echo '</td>'; … … 887 920 * @param string $status Status of the plugin. Defaults are 'All', 'Active', 888 921 * 'Inactive', 'Recently Activated', 'Upgrade', 'Must-Use', 889 * 'Drop-ins', 'Search' .922 * 'Drop-ins', 'Search', 'Paused'. 890 923 */ 891 924 do_action( 'after_plugin_row', $plugin_file, $plugin_data, $status ); … … 903 936 * @param string $status Status of the plugin. Defaults are 'All', 'Active', 904 937 * 'Inactive', 'Recently Activated', 'Upgrade', 'Must-Use', 905 * 'Drop-ins', 'Search' .938 * 'Drop-ins', 'Search', 'Paused'. 906 939 */ 907 940 do_action( "after_plugin_row_{$plugin_file}", $plugin_file, $plugin_data, $status );
Note: See TracChangeset
for help on using the changeset viewer.