Title: WP_Themes_List_Table::display_rows
Published: April 25, 2014
Last modified: May 20, 2026

---

# WP_Themes_List_Table::display_rows()

## In this article

 * [Source](https://developer.wordpress.org/reference/classes/wp_themes_list_table/display_rows/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/classes/wp_themes_list_table/display_rows/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/classes/wp_themes_list_table/display_rows/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_themes_list_table/display_rows/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_themes_list_table/display_rows/?output_format=md#wp--skip-link--target)

Generates the list table rows.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_themes_list_table/display_rows/?output_format=md#source)󠁿

    ```php
    public function display_rows() {
    	$themes = $this->items;

    	foreach ( $themes as $theme ) :
    		?>
    		<div class="available-theme">
    		<?php

    		$template   = $theme->get_template();
    		$stylesheet = $theme->get_stylesheet();
    		$title      = $theme->display( 'Name' );
    		$version    = $theme->display( 'Version' );
    		$author     = $theme->display( 'Author' );

    		$activate_link = wp_nonce_url( 'themes.php?action=activate&amp;template=' . urlencode( $template ) . '&amp;stylesheet=' . urlencode( $stylesheet ), 'switch-theme_' . $stylesheet );

    		$actions             = array();
    		$actions['activate'] = sprintf(
    			'<a href="%s" class="activatelink" aria-label="%s">%s</a>',
    			$activate_link,
    			/* translators: %s: Theme name. */
    			esc_attr( sprintf( _x( 'Activate &#8220;%s&#8221;', 'theme' ), $title ) ),
    			_x( 'Activate', 'theme' )
    		);

    		if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
    			$actions['preview'] .= sprintf(
    				'<a href="%s" class="load-customize hide-if-no-customize">%s</a>',
    				wp_customize_url( $stylesheet ),
    				__( 'Live Preview' )
    			);
    		}

    		if ( ! is_multisite() && current_user_can( 'delete_themes' ) ) {
    			$actions['delete'] = sprintf(
    				'<a class="submitdelete deletion" href="%s" onclick="return confirm( \'%s\' );">%s</a>',
    				wp_nonce_url( 'themes.php?action=delete&amp;stylesheet=' . urlencode( $stylesheet ), 'delete-theme_' . $stylesheet ),
    				/* translators: %s: Theme name. */
    				esc_js( sprintf( __( "You are about to delete this theme '%s'\n  'Cancel' to stop, 'OK' to delete." ), $title ) ),
    				__( 'Delete' )
    			);
    		}

    		/** This filter is documented in wp-admin/includes/class-wp-ms-themes-list-table.php */
    		$actions = apply_filters( 'theme_action_links', $actions, $theme, 'all' );

    		/** This filter is documented in wp-admin/includes/class-wp-ms-themes-list-table.php */
    		$actions       = apply_filters( "theme_action_links_{$stylesheet}", $actions, $theme, 'all' );
    		$delete_action = isset( $actions['delete'] ) ? '<div class="delete-theme">' . $actions['delete'] . '</div>' : '';
    		unset( $actions['delete'] );

    		$screenshot = $theme->get_screenshot();
    		?>

    		<span class="screenshot hide-if-customize">
    			<?php if ( $screenshot ) : ?>
    				<img src="<?php echo esc_url( $screenshot . '?ver=' . $theme->version ); ?>" alt="" />
    			<?php endif; ?>
    		</span>
    		<a href="<?php echo wp_customize_url( $stylesheet ); ?>" class="screenshot load-customize hide-if-no-customize">
    			<?php if ( $screenshot ) : ?>
    				<img src="<?php echo esc_url( $screenshot . '?ver=' . $theme->version ); ?>" alt="" />
    			<?php endif; ?>
    		</a>

    		<h3><?php echo $title; ?></h3>
    		<div class="theme-author">
    			<?php
    				/* translators: %s: Theme author. */
    				printf( __( 'By %s' ), $author );
    			?>
    		</div>
    		<div class="action-links">
    			<ul>
    				<?php foreach ( $actions as $action ) : ?>
    					<li><?php echo $action; ?></li>
    				<?php endforeach; ?>
    				<li class="hide-if-no-js"><a href="#" class="theme-detail"><?php _e( 'Details' ); ?></a></li>
    			</ul>
    			<?php echo $delete_action; ?>

    			<?php theme_update_available( $theme ); ?>
    		</div>

    		<div class="themedetaildiv hide-if-js">
    			<p><strong><?php _e( 'Version:' ); ?></strong> <?php echo $version; ?></p>
    			<p><?php echo $theme->display( 'Description' ); ?></p>
    			<?php
    			if ( $theme->parent() ) {
    				printf(
    					/* translators: 1: Link to documentation on child themes, 2: Name of parent theme. */
    					' <p class="howto">' . __( 'This <a href="%1$s">child theme</a> requires its parent theme, %2$s.' ) . '</p>',
    					__( 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' ),
    					$theme->parent()->display( 'Name' )
    				);
    			}
    			?>
    		</div>

    		</div>
    		<?php
    	endforeach;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-themes-list-table.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-admin/includes/class-wp-themes-list-table.php#L196)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-admin/includes/class-wp-themes-list-table.php#L196-L298)

## 󠀁[Hooks](https://developer.wordpress.org/reference/classes/wp_themes_list_table/display_rows/?output_format=md#hooks)󠁿

 [apply_filters( ‘theme_action_links’, string[] $actions, WP_Theme $theme, string $context )](https://developer.wordpress.org/reference/hooks/theme_action_links/)

Filters the action links displayed for each theme in the Multisite themes list table.

 [apply_filters( “theme_action_links_{$stylesheet}”, string[] $actions, WP_Theme $theme, string $context )](https://developer.wordpress.org/reference/hooks/theme_action_links_stylesheet/)

Filters the action links of a specific theme in the Multisite themes list table.

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_themes_list_table/display_rows/?output_format=md#related)󠁿

| Uses | Description | 
| [theme_update_available()](https://developer.wordpress.org/reference/functions/theme_update_available/)`wp-admin/includes/theme.php` |

Check if there is an update for a theme available.

  | 
| [wp_customize_url()](https://developer.wordpress.org/reference/functions/wp_customize_url/)`wp-includes/theme.php` |

Returns a URL to load the Customizer.

  | 
| [esc_js()](https://developer.wordpress.org/reference/functions/esc_js/)`wp-includes/formatting.php` |

Escapes single quotes, `"`, , `&amp;`, and fixes line endings.

  | 
| [current_user_can()](https://developer.wordpress.org/reference/functions/current_user_can/)`wp-includes/capabilities.php` |

Returns whether the current user has the specified capability.

  | 
| [_x()](https://developer.wordpress.org/reference/functions/_x/)`wp-includes/l10n.php` |

Retrieves translated string with gettext context.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [_e()](https://developer.wordpress.org/reference/functions/_e/)`wp-includes/l10n.php` |

Displays translated text.

  | 
| [esc_attr()](https://developer.wordpress.org/reference/functions/esc_attr/)`wp-includes/formatting.php` |

Escaping for HTML attributes.

  | 
| [esc_url()](https://developer.wordpress.org/reference/functions/esc_url/)`wp-includes/formatting.php` |

Checks and cleans a URL.

  | 
| [is_multisite()](https://developer.wordpress.org/reference/functions/is_multisite/)`wp-includes/load.php` |

Determines whether Multisite is enabled.

  | 
| [wp_nonce_url()](https://developer.wordpress.org/reference/functions/wp_nonce_url/)`wp-includes/functions.php` |

Retrieves URL with nonce added to URL query.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

[Show 9 more](https://developer.wordpress.org/reference/classes/wp_themes_list_table/display_rows/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/wp_themes_list_table/display_rows/?output_format=md#)

| Used by | Description | 
| [WP_Themes_List_Table::display_rows_or_placeholder()](https://developer.wordpress.org/reference/classes/wp_themes_list_table/display_rows_or_placeholder/)`wp-admin/includes/class-wp-themes-list-table.php` |  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_themes_list_table/display_rows/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_themes_list_table%2Fdisplay_rows%2F)
before being able to contribute a note or feedback.