WP_MS_Themes_List_Table::single_row_columns( WP_Theme $item )
- Since
- 4.3.0
- Source
wp-admin/includes/class-wp-ms-themes-list-table.php:932
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
$itemWP_Theme- The current WP_Theme object.
Performance profile
How much work a call to WP_MS_Themes_List_Table::single_row_columns() 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
- Heavy
- Scaling
- Scales with input
- Instructions
- 11–12
- Plugin surface
- None
- Called by
- 1
Reads stored settings via get_option(), cached per request but not free on a cold cache.
The body loops, so the work grows with what you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 125.
Nothing here hands control to plugin code.
1 place in core call this, so the cost is paid more often than your own code shows.
What it touches
- optionoption read or write
get_option()one call below WP_MS_Themes_List_Table::single_row_columns() - hookthird-party callbacks
apply_filters()one call below WP_MS_Themes_List_Table::single_row_columns()
Further down the call graph this can also reach 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 · 1 distinct outcome
One number would be a lie: the work depends on which branch runs. These are every distinct cost WP_MS_Themes_List_Table::single_row_columns() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
| always | 11–12 | ->get_column_info() |
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 125 | 11–12 | 12 | |
| 8.5 | 125 | 11–12 | 12 | |
| 8.4 | 125 | 11–12 | 12 | 3 fewer instructions than PHP 8.3 |
| 8.3 | 128 | 11–12 | 12 | |
| 8.2 | 128 | 11–12 | 12 | 3 fewer instructions than PHP 8.1 |
| 8.1 | 131 | 15–16 | 12 | |
| 7.4 | 131 | 15–16 | 12 |
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.
Uses · 9
- get_blog_option()Retrieves option value for a given blog id based on name of option.
- __()Retrieves the translation of $text.
- esc_attr()Escaping for HTML attributes.
- WP_MS_Themes_List_Table::get_column_info()
- WP_MS_Themes_List_Table::column_cb()Handles the checkbox column output.
- WP_MS_Themes_List_Table::column_name()Handles the name column output.
- WP_MS_Themes_List_Table::column_description()Handles the description column output.
- WP_MS_Themes_List_Table::column_autoupdates()Handles the auto-updates column output.
- WP_MS_Themes_List_Table::column_default()Handles default column output.
Used by · 1
- WP_MS_Themes_List_Table::single_row()Handles the output for a single table row.
Source code
public function single_row_columns( $item ) { list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info(); foreach ( $columns as $column_name => $column_display_name ) { $extra_classes = ''; if ( in_array( $column_name, $hidden, true ) ) { $extra_classes .= ' hidden'; } switch ( $column_name ) { case 'cb': echo '<td class="check-column">'; $this->column_cb( $item ); echo '</td>'; break; case 'name': $active_theme_label = ''; /* 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 */ if ( ! empty( $this->site_id ) ) { $stylesheet = get_blog_option( $this->site_id, 'stylesheet' ); $template = get_blog_option( $this->site_id, 'template' ); /* Add a label for the active template */ if ( $item->get_template() === $template ) { $active_theme_label = ' — ' . __( 'Active Theme' ); } /* In case this is a child theme, label it properly */ if ( $stylesheet !== $template && $item->get_stylesheet() === $stylesheet ) { $active_theme_label = ' — ' . __( 'Active Child Theme' ); } } echo "<th scope='row' class='theme-title column-primary{$extra_classes}' aria-label='" . esc_attr( $item->display( 'Name' ) ) . "'><strong>" . $item->display( 'Name' ) . $active_theme_label . '</strong>'; $this->column_name( $item ); echo '</th>'; break; case 'description': echo "<td class='column-description desc{$extra_classes}'>"; $this->column_description( $item ); echo '</td>'; break; case 'auto-updates': echo "<td class='column-auto-updates{$extra_classes}'>"; $this->column_autoupdates( $item ); echo '</td>'; break; default: echo "<td class='$column_name column-$column_name{$extra_classes}'>"; $this->column_default( $item, $column_name ); echo '</td>'; break; } } }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.