wppaste
WordPress

link_advanced_meta_box( object $link )

Since
2.6.0
Source
wp-admin/includes/meta-boxes.php:1444
Displays advanced link options form fields.

Compatibility

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

Performance profile

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

Touches nothing outside its own arguments.

Scaling
Scales with input

The body loops, so the work grows with what you pass in.

Instructions
43–56

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

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

  • hookthird-party callbacksapply_filters()one call below link_advanced_meta_box()

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 · 4 distinct outcomes

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

WhenInstructionsCalls it makes
!isset($link) && !$rating43–44_e(), _e(), _ex(), _e(), _e()
!$rating49–50_e(), _e(), esc_attr(), _ex(), _e(), _e()
!$rating49–50_e(), esc_attr(), _e(), _ex(), _e(), _e()
isset($link) && !$rating55–56_e(), esc_attr(), _e(), esc_attr(), _ex(), _e(), _e()

Across PHP versions

PHPCompiledExecutedBranchesNotes
8.6-dev6943–5462 fewer instructions than PHP 8.5
8.57143–566
8.47143–566
8.37143–566
8.27143–566
8.17143–566
7.47143–566

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

  • _e()Displays translated text.
  • esc_attr()Escaping for HTML attributes.
  • _ex()Displays translated string with gettext context.

Source code

function link_advanced_meta_box( $link ) {	?><table class="links-table" cellpadding="0">	<tr>		<th scope="row"><label for="link_image"><?php _e( 'Image Address' ); ?></label></th>		<td><input type="text" name="link_image" class="code" id="link_image" maxlength="255" value="<?php echo ( isset( $link->link_image ) ? esc_attr( $link->link_image ) : '' ); ?>" /></td>	</tr>	<tr>		<th scope="row"><label for="rss_uri"><?php _e( 'RSS Address' ); ?></label></th>		<td><input name="link_rss" class="code" type="text" id="rss_uri" maxlength="255" value="<?php echo ( isset( $link->link_rss ) ? esc_attr( $link->link_rss ) : '' ); ?>" /></td>	</tr>	<tr>		<th scope="row">			<label for="link_notes">				<?php				/* translators: Label for the Notes textarea in the Link Manager edit screen. */				_ex( 'Notes', 'Link manager notes field label' );				?>			</label>		</th>		<td><textarea name="link_notes" id="link_notes" rows="10"><?php echo $link->link_notes ?? ''; // textarea_escaped ?></textarea></td>	</tr>	<tr>		<th scope="row"><label for="link_rating"><?php _e( 'Rating' ); ?></label></th>		<td><select name="link_rating" id="link_rating" size="1">		<?php		for ( $rating = 0; $rating <= 10; $rating++ ) {			echo '<option value="' . $rating . '"';			if ( isset( $link->link_rating ) && $link->link_rating === $rating ) {				echo ' selected="selected"';			}			echo '>' . $rating . '</option>';		}		?>		</select>&nbsp;<?php _e( '(Leave at 0 for no rating.)' ); ?>		</td>	</tr></table>	<?php}

Changelog

Introduced in 2.6.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/meta-boxes.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.