wppaste
WordPress

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
Handles the description column output.

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

Touches nothing outside its own arguments.

Scaling
Constant

No loop in the body: the same number of instructions runs whatever you pass in.

Instructions
65–148

Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 154.

Plugin surface
1 hook

Third-party callbacks on 'theme_row_meta' run inside this call, and their cost is not bounded by anything here.

Called by
1

1 place in core call this, so the cost is paid more often than your own code shows.

What it touches

  • hookthird-party callbacksapply_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.

WhenInstructionsCalls 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

PHPCompiledExecutedBranchesNotes
8.6-dev15465–1489
8.515465–1489
8.415465–14892 fewer instructions than PHP 8.3
8.315668–1509
8.215668–1509
8.115668–15091 fewer instruction than PHP 7.4
7.415768–1519

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:

  1. 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

Used by · 1

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.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 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.