class-wp-ms-themes-list-table.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  1. <?php
  2. /**
  3. * List Table API: WP_MS_Themes_List_Table class
  4. *
  5. * @package WordPress
  6. * @subpackage Administration
  7. * @since 3.1.0
  8. */
  9. /**
  10. * Core class used to implement displaying themes in a list table for the network admin.
  11. *
  12. * @since 3.1.0
  13. * @access private
  14. *
  15. * @see WP_List_Table
  16. */
  17. class WP_MS_Themes_List_Table extends WP_List_Table {
  18. public $site_id;
  19. public $is_site_themes;
  20. private $has_items;
  21. /**
  22. * Constructor.
  23. *
  24. * @since 3.1.0
  25. *
  26. * @see WP_List_Table::__construct() for more information on default arguments.
  27. *
  28. * @global string $status
  29. * @global int $page
  30. *
  31. * @param array $args An associative array of arguments.
  32. */
  33. public function __construct( $args = array() ) {
  34. global $status, $page;
  35. parent::__construct( array(
  36. 'plural' => 'themes',
  37. 'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
  38. ) );
  39. $status = isset( $_REQUEST['theme_status'] ) ? $_REQUEST['theme_status'] : 'all';
  40. if ( !in_array( $status, array( 'all', 'enabled', 'disabled', 'upgrade', 'search', 'broken' ) ) )
  41. $status = 'all';
  42. $page = $this->get_pagenum();
  43. $this->is_site_themes = ( 'site-themes-network' === $this->screen->id ) ? true : false;
  44. if ( $this->is_site_themes )
  45. $this->site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
  46. }
  47. /**
  48. *
  49. * @return array
  50. */
  51. protected function get_table_classes() {
  52. // todo: remove and add CSS for .themes
  53. return array( 'widefat', 'plugins' );
  54. }
  55. /**
  56. *
  57. * @return bool
  58. */
  59. public function ajax_user_can() {
  60. if ( $this->is_site_themes )
  61. return current_user_can( 'manage_sites' );
  62. else
  63. return current_user_can( 'manage_network_themes' );
  64. }
  65. /**
  66. *
  67. * @global string $status
  68. * @global array $totals
  69. * @global int $page
  70. * @global string $orderby
  71. * @global string $order
  72. * @global string $s
  73. */
  74. public function prepare_items() {
  75. global $status, $totals, $page, $orderby, $order, $s;
  76. wp_reset_vars( array( 'orderby', 'order', 's' ) );
  77. $themes = array(
  78. /**
  79. * Filters the full array of WP_Theme objects to list in the Multisite
  80. * themes list table.
  81. *
  82. * @since 3.1.0
  83. *
  84. * @param array $all An array of WP_Theme objects to display in the list table.
  85. */
  86. 'all' => apply_filters( 'all_themes', wp_get_themes() ),
  87. 'search' => array(),
  88. 'enabled' => array(),
  89. 'disabled' => array(),
  90. 'upgrade' => array(),
  91. 'broken' => $this->is_site_themes ? array() : wp_get_themes( array( 'errors' => true ) ),
  92. );
  93. if ( $this->is_site_themes ) {
  94. $themes_per_page = $this->get_items_per_page( 'site_themes_network_per_page' );
  95. $allowed_where = 'site';
  96. } else {
  97. $themes_per_page = $this->get_items_per_page( 'themes_network_per_page' );
  98. $allowed_where = 'network';
  99. }
  100. $maybe_update = current_user_can( 'update_themes' ) && ! $this->is_site_themes && $current = get_site_transient( 'update_themes' );
  101. foreach ( (array) $themes['all'] as $key => $theme ) {
  102. if ( $this->is_site_themes && $theme->is_allowed( 'network' ) ) {
  103. unset( $themes['all'][ $key ] );
  104. continue;
  105. }
  106. if ( $maybe_update && isset( $current->response[ $key ] ) ) {
  107. $themes['all'][ $key ]->update = true;
  108. $themes['upgrade'][ $key ] = $themes['all'][ $key ];
  109. }
  110. $filter = $theme->is_allowed( $allowed_where, $this->site_id ) ? 'enabled' : 'disabled';
  111. $themes[ $filter ][ $key ] = $themes['all'][ $key ];
  112. }
  113. if ( $s ) {
  114. $status = 'search';
  115. $themes['search'] = array_filter( array_merge( $themes['all'], $themes['broken'] ), array( $this, '_search_callback' ) );
  116. }
  117. $totals = array();
  118. foreach ( $themes as $type => $list )
  119. $totals[ $type ] = count( $list );
  120. if ( empty( $themes[ $status ] ) && !in_array( $status, array( 'all', 'search' ) ) )
  121. $status = 'all';
  122. $this->items = $themes[ $status ];
  123. WP_Theme::sort_by_name( $this->items );
  124. $this->has_items = ! empty( $themes['all'] );
  125. $total_this_page = $totals[ $status ];
  126. wp_localize_script( 'updates', '_wpUpdatesItemCounts', array(
  127. 'themes' => $totals,
  128. 'totals' => wp_get_update_data(),
  129. ) );
  130. if ( $orderby ) {
  131. $orderby = ucfirst( $orderby );
  132. $order = strtoupper( $order );
  133. if ( $orderby === 'Name' ) {
  134. if ( 'ASC' === $order ) {
  135. $this->items = array_reverse( $this->items );
  136. }
  137. } else {
  138. uasort( $this->items, array( $this, '_order_callback' ) );
  139. }
  140. }
  141. $start = ( $page - 1 ) * $themes_per_page;
  142. if ( $total_this_page > $themes_per_page )
  143. $this->items = array_slice( $this->items, $start, $themes_per_page, true );
  144. $this->set_pagination_args( array(
  145. 'total_items' => $total_this_page,
  146. 'per_page' => $themes_per_page,
  147. ) );
  148. }
  149. /**
  150. * @staticvar string $term
  151. * @param WP_Theme $theme
  152. * @return bool
  153. */
  154. public function _search_callback( $theme ) {
  155. static $term = null;
  156. if ( is_null( $term ) )
  157. $term = wp_unslash( $_REQUEST['s'] );
  158. foreach ( array( 'Name', 'Description', 'Author', 'Author', 'AuthorURI' ) as $field ) {
  159. // Don't mark up; Do translate.
  160. if ( false !== stripos( $theme->display( $field, false, true ), $term ) )
  161. return true;
  162. }
  163. if ( false !== stripos( $theme->get_stylesheet(), $term ) )
  164. return true;
  165. if ( false !== stripos( $theme->get_template(), $term ) )
  166. return true;
  167. return false;
  168. }
  169. // Not used by any core columns.
  170. /**
  171. * @global string $orderby
  172. * @global string $order
  173. * @param array $theme_a
  174. * @param array $theme_b
  175. * @return int
  176. */
  177. public function _order_callback( $theme_a, $theme_b ) {
  178. global $orderby, $order;
  179. $a = $theme_a[ $orderby ];
  180. $b = $theme_b[ $orderby ];
  181. if ( $a == $b )
  182. return 0;
  183. if ( 'DESC' === $order )
  184. return ( $a < $b ) ? 1 : -1;
  185. else
  186. return ( $a < $b ) ? -1 : 1;
  187. }
  188. /**
  189. */
  190. public function no_items() {
  191. if ( $this->has_items ) {
  192. _e( 'No themes found.' );
  193. } else {
  194. _e( 'You do not appear to have any themes available at this time.' );
  195. }
  196. }
  197. /**
  198. *
  199. * @return array
  200. */
  201. public function get_columns() {
  202. return array(
  203. 'cb' => '<input type="checkbox" />',
  204. 'name' => __( 'Theme' ),
  205. 'description' => __( 'Description' ),
  206. );
  207. }
  208. /**
  209. *
  210. * @return array
  211. */
  212. protected function get_sortable_columns() {
  213. return array(
  214. 'name' => 'name',
  215. );
  216. }
  217. /**
  218. * Gets the name of the primary column.
  219. *
  220. * @since 4.3.0
  221. *
  222. * @return string Unalterable name of the primary column name, in this case, 'name'.
  223. */
  224. protected function get_primary_column_name() {
  225. return 'name';
  226. }
  227. /**
  228. *
  229. * @global array $totals
  230. * @global string $status
  231. * @return array
  232. */
  233. protected function get_views() {
  234. global $totals, $status;
  235. $status_links = array();
  236. foreach ( $totals as $type => $count ) {
  237. if ( !$count )
  238. continue;
  239. switch ( $type ) {
  240. case 'all':
  241. $text = _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'themes' );
  242. break;
  243. case 'enabled':
  244. $text = _n( 'Enabled <span class="count">(%s)</span>', 'Enabled <span class="count">(%s)</span>', $count );
  245. break;
  246. case 'disabled':
  247. $text = _n( 'Disabled <span class="count">(%s)</span>', 'Disabled <span class="count">(%s)</span>', $count );
  248. break;
  249. case 'upgrade':
  250. $text = _n( 'Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count );
  251. break;
  252. case 'broken' :
  253. $text = _n( 'Broken <span class="count">(%s)</span>', 'Broken <span class="count">(%s)</span>', $count );
  254. break;
  255. }
  256. if ( $this->is_site_themes )
  257. $url = 'site-themes.php?id=' . $this->site_id;
  258. else
  259. $url = 'themes.php';
  260. if ( 'search' != $type ) {
  261. $status_links[$type] = sprintf( "<a href='%s'%s>%s</a>",
  262. esc_url( add_query_arg('theme_status', $type, $url) ),
  263. ( $type === $status ) ? ' class="current" aria-current="page"' : '',
  264. sprintf( $text, number_format_i18n( $count ) )
  265. );
  266. }
  267. }
  268. return $status_links;
  269. }
  270. /**
  271. * @global string $status
  272. *
  273. * @return array
  274. */
  275. protected function get_bulk_actions() {
  276. global $status;
  277. $actions = array();
  278. if ( 'enabled' != $status )
  279. $actions['enable-selected'] = $this->is_site_themes ? __( 'Enable' ) : __( 'Network Enable' );
  280. if ( 'disabled' != $status )
  281. $actions['disable-selected'] = $this->is_site_themes ? __( 'Disable' ) : __( 'Network Disable' );
  282. if ( ! $this->is_site_themes ) {
  283. if ( current_user_can( 'update_themes' ) )
  284. $actions['update-selected'] = __( 'Update' );
  285. if ( current_user_can( 'delete_themes' ) )
  286. $actions['delete-selected'] = __( 'Delete' );
  287. }
  288. return $actions;
  289. }
  290. /**
  291. */
  292. public function display_rows() {
  293. foreach ( $this->items as $theme )
  294. $this->single_row( $theme );
  295. }
  296. /**
  297. * Handles the checkbox column output.
  298. *
  299. * @since 4.3.0
  300. *
  301. * @param WP_Theme $theme The current WP_Theme object.
  302. */
  303. public function column_cb( $theme ) {
  304. $checkbox_id = 'checkbox_' . md5( $theme->get('Name') );
  305. ?>
  306. <input type="checkbox" name="checked[]" value="<?php echo esc_attr( $theme->get_stylesheet() ) ?>" id="<?php echo $checkbox_id ?>" />
  307. <label class="screen-reader-text" for="<?php echo $checkbox_id ?>" ><?php _e( 'Select' ) ?> <?php echo $theme->display( 'Name' ) ?></label>
  308. <?php
  309. }
  310. /**
  311. * Handles the name column output.
  312. *
  313. * @since 4.3.0
  314. *
  315. * @global string $status
  316. * @global int $page
  317. * @global string $s
  318. *
  319. * @param WP_Theme $theme The current WP_Theme object.
  320. */
  321. public function column_name( $theme ) {
  322. global $status, $page, $s;
  323. $context = $status;
  324. if ( $this->is_site_themes ) {
  325. $url = "site-themes.php?id={$this->site_id}&amp;";
  326. $allowed = $theme->is_allowed( 'site', $this->site_id );
  327. } else {
  328. $url = 'themes.php?';
  329. $allowed = $theme->is_allowed( 'network' );
  330. }
  331. // Pre-order.
  332. $actions = array(
  333. 'enable' => '',
  334. 'disable' => '',
  335. 'delete' => ''
  336. );
  337. $stylesheet = $theme->get_stylesheet();
  338. $theme_key = urlencode( $stylesheet );
  339. if ( ! $allowed ) {
  340. if ( ! $theme->errors() ) {
  341. $url = add_query_arg( array(
  342. 'action' => 'enable',
  343. 'theme' => $theme_key,
  344. 'paged' => $page,
  345. 's' => $s,
  346. ), $url );
  347. if ( $this->is_site_themes ) {
  348. /* translators: %s: theme name */
  349. $aria_label = sprintf( __( 'Enable %s' ), $theme->display( 'Name' ) );
  350. } else {
  351. /* translators: %s: theme name */
  352. $aria_label = sprintf( __( 'Network Enable %s' ), $theme->display( 'Name' ) );
  353. }
  354. $actions['enable'] = sprintf( '<a href="%s" class="edit" aria-label="%s">%s</a>',
  355. esc_url( wp_nonce_url( $url, 'enable-theme_' . $stylesheet ) ),
  356. esc_attr( $aria_label ),
  357. ( $this->is_site_themes ? __( 'Enable' ) : __( 'Network Enable' ) )
  358. );
  359. }
  360. } else {
  361. $url = add_query_arg( array(
  362. 'action' => 'disable',
  363. 'theme' => $theme_key,
  364. 'paged' => $page,
  365. 's' => $s,
  366. ), $url );
  367. if ( $this->is_site_themes ) {
  368. /* translators: %s: theme name */
  369. $aria_label = sprintf( __( 'Disable %s' ), $theme->display( 'Name' ) );
  370. } else {
  371. /* translators: %s: theme name */
  372. $aria_label = sprintf( __( 'Network Disable %s' ), $theme->display( 'Name' ) );
  373. }
  374. $actions['disable'] = sprintf( '<a href="%s" aria-label="%s">%s</a>',
  375. esc_url( wp_nonce_url( $url, 'disable-theme_' . $stylesheet ) ),
  376. esc_attr( $aria_label ),
  377. ( $this->is_site_themes ? __( 'Disable' ) : __( 'Network Disable' ) )
  378. );
  379. }
  380. if ( ! $allowed && current_user_can( 'delete_themes' ) && ! $this->is_site_themes && $stylesheet != get_option( 'stylesheet' ) && $stylesheet != get_option( 'template' ) ) {
  381. $url = add_query_arg( array(
  382. 'action' => 'delete-selected',
  383. 'checked[]' => $theme_key,
  384. 'theme_status' => $context,
  385. 'paged' => $page,
  386. 's' => $s,
  387. ), 'themes.php' );
  388. /* translators: %s: theme name */
  389. $aria_label = sprintf( _x( 'Delete %s', 'theme' ), $theme->display( 'Name' ) );
  390. $actions['delete'] = sprintf( '<a href="%s" class="delete" aria-label="%s">%s</a>',
  391. esc_url( wp_nonce_url( $url, 'bulk-themes' ) ),
  392. esc_attr( $aria_label ),
  393. __( 'Delete' )
  394. );
  395. }
  396. /**
  397. * Filters the action links displayed for each theme in the Multisite
  398. * themes list table.
  399. *
  400. * The action links displayed are determined by the theme's status, and
  401. * which Multisite themes list table is being displayed - the Network
  402. * themes list table (themes.php), which displays all installed themes,
  403. * or the Site themes list table (site-themes.php), which displays the
  404. * non-network enabled themes when editing a site in the Network admin.
  405. *
  406. * The default action links for the Network themes list table include
  407. * 'Network Enable', 'Network Disable', and 'Delete'.
  408. *
  409. * The default action links for the Site themes list table include
  410. * 'Enable', and 'Disable'.
  411. *
  412. * @since 2.8.0
  413. *
  414. * @param array $actions An array of action links.
  415. * @param WP_Theme $theme The current WP_Theme object.
  416. * @param string $context Status of the theme, one of 'all', 'enabled', or 'disabled'.
  417. */
  418. $actions = apply_filters( 'theme_action_links', array_filter( $actions ), $theme, $context );
  419. /**
  420. * Filters the action links of a specific theme in the Multisite themes
  421. * list table.
  422. *
  423. * The dynamic portion of the hook name, `$stylesheet`, refers to the
  424. * directory name of the theme, which in most cases is synonymous
  425. * with the template name.
  426. *
  427. * @since 3.1.0
  428. *
  429. * @param array $actions An array of action links.
  430. * @param WP_Theme $theme The current WP_Theme object.
  431. * @param string $context Status of the theme, one of 'all', 'enabled', or 'disabled'.
  432. */
  433. $actions = apply_filters( "theme_action_links_{$stylesheet}", $actions, $theme, $context );
  434. echo $this->row_actions( $actions, true );
  435. }
  436. /**
  437. * Handles the description column output.
  438. *
  439. * @since 4.3.0
  440. *
  441. * @global string $status
  442. * @global array $totals
  443. *
  444. * @param WP_Theme $theme The current WP_Theme object.
  445. */
  446. public function column_description( $theme ) {
  447. global $status, $totals;
  448. if ( $theme->errors() ) {
  449. $pre = $status === 'broken' ? __( 'Broken Theme:' ) . ' ' : '';
  450. echo '<p><strong class="error-message">' . $pre . $theme->errors()->get_error_message() . '</strong></p>';
  451. }
  452. if ( $this->is_site_themes ) {
  453. $allowed = $theme->is_allowed( 'site', $this->site_id );
  454. } else {
  455. $allowed = $theme->is_allowed( 'network' );
  456. }
  457. $class = ! $allowed ? 'inactive' : 'active';
  458. if ( ! empty( $totals['upgrade'] ) && ! empty( $theme->update ) )
  459. $class .= ' update';
  460. echo "<div class='theme-description'><p>" . $theme->display( 'Description' ) . "</p></div>
  461. <div class='$class second theme-version-author-uri'>";
  462. $stylesheet = $theme->get_stylesheet();
  463. $theme_meta = array();
  464. if ( $theme->get('Version') ) {
  465. $theme_meta[] = sprintf( __( 'Version %s' ), $theme->display('Version') );
  466. }
  467. $theme_meta[] = sprintf( __( 'By %s' ), $theme->display('Author') );
  468. if ( $theme->get('ThemeURI') ) {
  469. /* translators: %s: theme name */
  470. $aria_label = sprintf( __( 'Visit %s homepage' ), $theme->display( 'Name' ) );
  471. $theme_meta[] = sprintf( '<a href="%s" aria-label="%s">%s</a>',
  472. $theme->display( 'ThemeURI' ),
  473. esc_attr( $aria_label ),
  474. __( 'Visit Theme Site' )
  475. );
  476. }
  477. /**
  478. * Filters the array of row meta for each theme in the Multisite themes
  479. * list table.
  480. *
  481. * @since 3.1.0
  482. *
  483. * @param array $theme_meta An array of the theme's metadata,
  484. * including the version, author, and
  485. * theme URI.
  486. * @param string $stylesheet Directory name of the theme.
  487. * @param WP_Theme $theme WP_Theme object.
  488. * @param string $status Status of the theme.
  489. */
  490. $theme_meta = apply_filters( 'theme_row_meta', $theme_meta, $stylesheet, $theme, $status );
  491. echo implode( ' | ', $theme_meta );
  492. echo '</div>';
  493. }
  494. /**
  495. * Handles default column output.
  496. *
  497. * @since 4.3.0
  498. *
  499. * @param WP_Theme $theme The current WP_Theme object.
  500. * @param string $column_name The current column name.
  501. */
  502. public function column_default( $theme, $column_name ) {
  503. $stylesheet = $theme->get_stylesheet();
  504. /**
  505. * Fires inside each custom column of the Multisite themes list table.
  506. *
  507. * @since 3.1.0
  508. *
  509. * @param string $column_name Name of the column.
  510. * @param string $stylesheet Directory name of the theme.
  511. * @param WP_Theme $theme Current WP_Theme object.
  512. */
  513. do_action( 'manage_themes_custom_column', $column_name, $stylesheet, $theme );
  514. }
  515. /**
  516. * Handles the output for a single table row.
  517. *
  518. * @since 4.3.0
  519. *
  520. * @param WP_Theme $item The current WP_Theme object.
  521. */
  522. public function single_row_columns( $item ) {
  523. list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
  524. foreach ( $columns as $column_name => $column_display_name ) {
  525. $extra_classes = '';
  526. if ( in_array( $column_name, $hidden ) ) {
  527. $extra_classes .= ' hidden';
  528. }
  529. switch ( $column_name ) {
  530. case 'cb':
  531. echo '<th scope="row" class="check-column">';
  532. $this->column_cb( $item );
  533. echo '</th>';
  534. break;
  535. case 'name':
  536. $active_theme_label = '';
  537. /* The presence of the site_id property means that this is a subsite view and a label for the active theme needs to be added */
  538. if ( ! empty( $this->site_id ) ) {
  539. $stylesheet = get_blog_option( $this->site_id, 'stylesheet' );
  540. $template = get_blog_option( $this->site_id, 'template' );
  541. /* Add a label for the active template */
  542. if ( $item->get_template() === $template ) {
  543. $active_theme_label = ' &mdash; ' . __( 'Active Theme' );
  544. }
  545. /* In case this is a child theme, label it properly */
  546. if ( $stylesheet !== $template && $item->get_stylesheet() === $stylesheet) {
  547. $active_theme_label = ' &mdash; ' . __( 'Active Child Theme' );
  548. }
  549. }
  550. echo "<td class='theme-title column-primary{$extra_classes}'><strong>" . $item->display( 'Name' ) . $active_theme_label . '</strong>';
  551. $this->column_name( $item );
  552. echo "</td>";
  553. break;
  554. case 'description':
  555. echo "<td class='column-description desc{$extra_classes}'>";
  556. $this->column_description( $item );
  557. echo '</td>';
  558. break;
  559. default:
  560. echo "<td class='$column_name column-$column_name{$extra_classes}'>";
  561. $this->column_default( $item, $column_name );
  562. echo "</td>";
  563. break;
  564. }
  565. }
  566. }
  567. /**
  568. * @global string $status
  569. * @global array $totals
  570. *
  571. * @param WP_Theme $theme
  572. */
  573. public function single_row( $theme ) {
  574. global $status, $totals;
  575. if ( $this->is_site_themes ) {
  576. $allowed = $theme->is_allowed( 'site', $this->site_id );
  577. } else {
  578. $allowed = $theme->is_allowed( 'network' );
  579. }
  580. $stylesheet = $theme->get_stylesheet();
  581. $class = ! $allowed ? 'inactive' : 'active';
  582. if ( ! empty( $totals['upgrade'] ) && ! empty( $theme->update ) ) {
  583. $class .= ' update';
  584. }
  585. printf( '<tr class="%s" data-slug="%s">',
  586. esc_attr( $class ),
  587. esc_attr( $stylesheet )
  588. );
  589. $this->single_row_columns( $theme );
  590. echo "</tr>";
  591. if ( $this->is_site_themes )
  592. remove_action( "after_theme_row_$stylesheet", 'wp_theme_update_row' );
  593. /**
  594. * Fires after each row in the Multisite themes list table.
  595. *
  596. * @since 3.1.0
  597. *
  598. * @param string $stylesheet Directory name of the theme.
  599. * @param WP_Theme $theme Current WP_Theme object.
  600. * @param string $status Status of the theme.
  601. */
  602. do_action( 'after_theme_row', $stylesheet, $theme, $status );
  603. /**
  604. * Fires after each specific row in the Multisite themes list table.
  605. *
  606. * The dynamic portion of the hook name, `$stylesheet`, refers to the
  607. * directory name of the theme, most often synonymous with the template
  608. * name of the theme.
  609. *
  610. * @since 3.5.0
  611. *
  612. * @param string $stylesheet Directory name of the theme.
  613. * @param WP_Theme $theme Current WP_Theme object.
  614. * @param string $status Status of the theme.
  615. */
  616. do_action( "after_theme_row_{$stylesheet}", $stylesheet, $theme, $status );
  617. }
  618. }