wppaste
WordPress

core_update_footer( string $msg = '' ): string

Since
2.3.0
Source
wp-admin/includes/update.php:247
Returns core update footer message.

Compatibility

WordPress
since 2.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

$msgstringoptional
Default: ''

Return value

string
The core update footer message.

Performance profile

How much work a call to core_update_footer() 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
Moderate

Reads stored settings via get_option(), cached per request but not free on a cold cache.

Scaling
Constant

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

Instructions
17–47

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

Plugin surface
None

Nothing here hands control to plugin code.

Called by
0

Nothing in core calls this; the cost is only what you spend yourself.

What it touches

  • optionoption read or writeget_option()one call below core_update_footer()
  • hookthird-party callbacksapply_filters()one call below core_update_footer()

Further down the call graph this can also reach cache, serialize, transient and query. Those are the worst case, several calls deep and usually down an error path, not what a normal call pays.

What one call costs · 4 distinct outcomes

One number would be a lie: the work depends on which branch runs. These are every distinct cost core_update_footer() can have, taken from its control-flow graph on PHP 8.5.

WhenInstructionsCalls it makes
!current_user_can()17current_user_can(), __(), get_bloginfo(), sprintf()
current_user_can()33–44current_user_can(), get_preferred_from_update_core(), wp_get_wp_version(), __(), get_bloginfo(), sprintf()
current_user_can()34–41current_user_can(), get_preferred_from_update_core(), wp_get_wp_version(), __(), get_bloginfo(), network_admin_url(), sprintf()
current_user_can()38–47current_user_can(), get_preferred_from_update_core(), wp_get_wp_version(), network_admin_url(), __(), sprintf()

Across PHP versions

PHPCompiledExecutedBranchesNotes
8.6-dev9117–477
8.59117–477
8.49117–4773 fewer instructions than PHP 8.3
8.39417–507
8.29417–507
8.19417–507
7.49417–507

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 · 7

Source code

function core_update_footer( $msg = '' ) {	if ( ! current_user_can( 'update_core' ) ) {		/* translators: %s: WordPress version. */		return sprintf( __( 'Version %s' ), get_bloginfo( 'version', 'display' ) );	} 	$cur = get_preferred_from_update_core(); 	if ( ! is_object( $cur ) ) {		$cur = new stdClass();	} 	if ( ! isset( $cur->current ) ) {		$cur->current = '';	} 	if ( ! isset( $cur->response ) ) {		$cur->response = '';	} 	$is_development_version = preg_match( '/alpha|beta|RC/', wp_get_wp_version() ); 	if ( $is_development_version ) {		return sprintf(			/* translators: 1: WordPress version number, 2: URL to WordPress Updates screen. */			__( 'You are using a development version (%1$s). Cool! Please <a href="%2$s">stay updated</a>.' ),			get_bloginfo( 'version', 'display' ),			network_admin_url( 'update-core.php' )		);	} 	switch ( $cur->response ) {		case 'upgrade':			return sprintf(				'<strong><a href="%s">%s</a></strong>',				network_admin_url( 'update-core.php' ),				/* translators: %s: WordPress version. */				sprintf( __( 'Get Version %s' ), $cur->current )			); 		case 'latest':		default:			/* translators: %s: WordPress version. */			return sprintf( __( 'Version %s' ), get_bloginfo( 'version', 'display' ) );	}}

Changelog

Introduced in 2.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/update.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.