WP_MS_Themes_List_Table::column_description( WP_Theme $theme )
- Since
- 4.3.0
- Source
wp-admin/includes/class-wp-ms-themes-list-table.php:718
Compatibility
- WordPress
- since 4.3.0
- PHP
- 7.4–8.6-dev
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.
Parameters
$themeWP_Theme- The current WP_Theme object.
Performance profile
How much work a call to WP_MS_Themes_List_Table::column_description() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.
- Cost class
- Trivial
- Scaling
- Constant
- Instructions
- 65–148
- Plugin surface
- 1 hook
- Called by
- 1
Touches nothing outside its own arguments.
No loop in the body: the same number of instructions runs whatever you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 154.
Third-party callbacks on 'theme_row_meta' run inside this call, and their cost is not bounded by anything here.
1 place in core call this, so the cost is paid more often than your own code shows.
What it touches
- hookthird-party callbacks
apply_filters()called directly
Further down the call graph this can also reach option, cache, serialize, query and transient. Those are the worst case, several calls deep and usually down an error path, not what a normal call pays.
What one call costs · 24 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost WP_MS_Themes_List_Table::column_description() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
!->errors() && !->get() && !->parent() | 65–73 | ->errors(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), ->get(), ->parent(), apply_filters() |
!->errors() && !->parent() | 77–85 | ->errors(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), __(), ->display(), sprintf(), ->get(), ->parent(), apply_filters() |
->errors() && $status !== "broken" && !->get() && !->parent() | 78–86 | ->errors(), ->errors(), ->get_error_message(), wp_admin_notice(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), ->get(), ->parent(), apply_filters() |
!->errors() && !->get() && ->parent() | 81–89 | ->errors(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), ->get(), ->parent(), __(), ->parent(), ->display(), sprintf(), apply_filters() |
->errors() && $status === "broken" && !->get() && !->parent() | 83–91 | ->errors(), __(), ->errors(), ->get_error_message(), wp_admin_notice(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), ->get(), ->parent(), apply_filters() |
->errors() && $status !== "broken" && !->parent() | 90–98 | ->errors(), ->errors(), ->get_error_message(), wp_admin_notice(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), __(), ->display(), sprintf(), ->get(), ->parent(), apply_filters() |
!->errors() && ->parent() | 93–101 | ->errors(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), __(), ->display(), sprintf(), ->get(), ->parent(), __(), ->parent(), ->display(), sprintf(), apply_filters() |
!->errors() && !->parent() | 94–102 | ->errors(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), ->get(), __(), ->display(), sprintf(), ->display(), esc_attr(), __(), ->parent(), apply_filters() |
->errors() && $status !== "broken" && !->get() && ->parent() | 94–102 | ->errors(), ->errors(), ->get_error_message(), wp_admin_notice(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), ->get(), ->parent(), __(), ->parent(), ->display(), sprintf(), apply_filters() |
->errors() && $status === "broken" && !->parent() | 95–103 | ->errors(), __(), ->errors(), ->get_error_message(), wp_admin_notice(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), __(), ->display(), sprintf(), ->get(), ->parent(), apply_filters() |
->errors() && $status === "broken" && !->get() && ->parent() | 99–107 | ->errors(), __(), ->errors(), ->get_error_message(), wp_admin_notice(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), ->get(), ->parent(), __(), ->parent(), ->display(), sprintf(), apply_filters() |
!->errors() && ->get() && !->parent() | 106–114 | ->errors(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), __(), ->display(), sprintf(), ->get(), __(), ->display(), sprintf(), ->display(), esc_attr(), __(), ->parent(), apply_filters() |
12 further outcomes, up to 148 instructions
->errors() && $status !== "broken" && ->parent() | 106–114 | ->errors(), ->errors(), ->get_error_message(), wp_admin_notice(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), __(), ->display(), sprintf(), ->get(), ->parent(), __(), ->parent(), ->display(), sprintf(), apply_filters() |
->errors() && $status !== "broken" && !->parent() | 107–115 | ->errors(), ->errors(), ->get_error_message(), wp_admin_notice(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), ->get(), __(), ->display(), sprintf(), ->display(), esc_attr(), __(), ->parent(), apply_filters() |
!->errors() && ->parent() | 110–118 | ->errors(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), ->get(), __(), ->display(), sprintf(), ->display(), esc_attr(), __(), ->parent(), __(), ->parent(), ->display(), sprintf(), apply_filters() |
->errors() && $status === "broken" && ->parent() | 111–119 | ->errors(), __(), ->errors(), ->get_error_message(), wp_admin_notice(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), __(), ->display(), sprintf(), ->get(), ->parent(), __(), ->parent(), ->display(), sprintf(), apply_filters() |
->errors() && $status === "broken" && !->parent() | 112–120 | ->errors(), __(), ->errors(), ->get_error_message(), wp_admin_notice(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), ->get(), __(), ->display(), sprintf(), ->display(), esc_attr(), __(), ->parent(), apply_filters() |
->errors() && $status !== "broken" && ->get() && !->parent() | 119–127 | ->errors(), ->errors(), ->get_error_message(), wp_admin_notice(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), __(), ->display(), sprintf(), ->get(), __(), ->display(), sprintf(), ->display(), esc_attr(), __(), ->parent(), apply_filters() |
!->errors() && ->get() && ->parent() | 122–130 | ->errors(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), __(), ->display(), sprintf(), ->get(), __(), ->display(), sprintf(), ->display(), esc_attr(), __(), ->parent(), __(), ->parent(), ->display(), sprintf(), apply_filters() |
->errors() && $status !== "broken" && ->parent() | 123–131 | ->errors(), ->errors(), ->get_error_message(), wp_admin_notice(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), ->get(), __(), ->display(), sprintf(), ->display(), esc_attr(), __(), ->parent(), __(), ->parent(), ->display(), sprintf(), apply_filters() |
->errors() && $status === "broken" && ->get() && !->parent() | 124–132 | ->errors(), __(), ->errors(), ->get_error_message(), wp_admin_notice(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), __(), ->display(), sprintf(), ->get(), __(), ->display(), sprintf(), ->display(), esc_attr(), __(), ->parent(), apply_filters() |
->errors() && $status === "broken" && ->parent() | 128–136 | ->errors(), __(), ->errors(), ->get_error_message(), wp_admin_notice(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), ->get(), __(), ->display(), sprintf(), ->display(), esc_attr(), __(), ->parent(), __(), ->parent(), ->display(), sprintf(), apply_filters() |
->errors() && $status !== "broken" && ->get() && ->parent() | 135–143 | ->errors(), ->errors(), ->get_error_message(), wp_admin_notice(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), __(), ->display(), sprintf(), ->get(), __(), ->display(), sprintf(), ->display(), esc_attr(), __(), ->parent(), __(), ->parent(), ->display(), sprintf(), apply_filters() |
->errors() && $status === "broken" && ->get() && ->parent() | 140–148 | ->errors(), __(), ->errors(), ->get_error_message(), wp_admin_notice(), ->is_allowed(), ->display(), ->get_stylesheet(), ->get(), __(), ->display(), sprintf(), __(), ->display(), sprintf(), ->get(), __(), ->display(), sprintf(), ->display(), esc_attr(), __(), ->parent(), __(), ->parent(), ->display(), sprintf(), apply_filters() |
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 154 | 65–148 | 9 | |
| 8.5 | 154 | 65–148 | 9 | |
| 8.4 | 154 | 65–148 | 9 | 2 fewer instructions than PHP 8.3 |
| 8.3 | 156 | 68–150 | 9 | |
| 8.2 | 156 | 68–150 | 9 | |
| 8.1 | 156 | 68–150 | 9 | 1 fewer instruction than PHP 7.4 |
| 7.4 | 157 | 68–151 | 9 |
An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.
Hooks and filters fired · 1
One hook fires while WP_MS_Themes_List_Table::column_description() runs, in this order:
- apply_filters( theme_row_meta )filterline 789 (+71 into the body)
Filters the array of row meta for each theme in the Multisite themes list table.
Uses · 4
- __()Retrieves the translation of $text.
- wp_admin_notice()Outputs an admin notice.
- esc_attr()Escaping for HTML attributes.
- apply_filters()Calls the callback functions that have been added to a filter hook.
Used by · 1
- WP_MS_Themes_List_Table::single_row_columns()Handles the output for a single table row.
Source code
public function column_description( $theme ) { global $status, $totals; if ( $theme->errors() ) { $pre = 'broken' === $status ? '<strong class="error-message">' . __( 'Broken Theme:' ) . '</strong> ' : ''; wp_admin_notice( $pre . $theme->errors()->get_error_message(), array( 'type' => 'error', 'additional_classes' => 'inline', ) ); } if ( $this->is_site_themes ) { $allowed = $theme->is_allowed( 'site', $this->site_id ); } else { $allowed = $theme->is_allowed( 'network' ); } $class = ! $allowed ? 'inactive' : 'active'; if ( ! empty( $totals['upgrade'] ) && ! empty( $theme->update ) ) { $class .= ' update'; } echo "<div class='theme-description'><p>" . $theme->display( 'Description' ) . "</p></div> <div class='$class second theme-version-author-uri'>"; $stylesheet = $theme->get_stylesheet(); $theme_meta = array(); if ( $theme->get( 'Version' ) ) { /* translators: %s: Theme version. */ $theme_meta[] = sprintf( __( 'Version %s' ), $theme->display( 'Version' ) ); } /* translators: %s: Theme author. */ $theme_meta[] = sprintf( __( 'By %s' ), $theme->display( 'Author' ) ); if ( $theme->get( 'ThemeURI' ) ) { /* translators: %s: Theme name. */ $aria_label = sprintf( __( 'Visit theme site for %s' ), $theme->display( 'Name' ) ); $theme_meta[] = sprintf( '<a href="%s" aria-label="%s">%s</a>', $theme->display( 'ThemeURI' ), esc_attr( $aria_label ), __( 'Visit Theme Site' ) ); } if ( $theme->parent() ) { $theme_meta[] = sprintf( /* translators: %s: Theme name. */ __( 'Child theme of %s' ), '<strong>' . $theme->parent()->display( 'Name' ) . '</strong>' ); } /** * Filters the array of row meta for each theme in the Multisite themes * list table. * * @since 3.1.0 * * @param string[] $theme_meta An array of the theme's metadata, including * the version, author, and theme URI. * @param string $stylesheet Directory name of the theme. * @param WP_Theme $theme WP_Theme object. * @param string $status Status of the theme. */ $theme_meta = apply_filters( 'theme_row_meta', $theme_meta, $stylesheet, $theme, $status ); echo implode( ' | ', $theme_meta ); echo '</div>'; }Changelog
Introduced in 4.3.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-admin/includes/class-wp-ms-themes-list-table.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.