link_advanced_meta_box( object $link )
- Since
- 2.6.0
- Source
wp-admin/includes/meta-boxes.php:1444
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
$linkobject- Current link object.
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
- Scaling
- Scales with input
- Instructions
- 43–56
- Plugin surface
- None
- Called by
- 0
Touches nothing outside its own arguments.
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 72.
Nothing here hands control to plugin code.
Nothing in core calls this; the cost is only what you spend yourself.
What it touches
- hookthird-party callbacks
apply_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.
| When | Instructions | Calls it makes |
|---|---|---|
!isset($link) && !$rating | 43–44 | _e(), _e(), _e(), _e(), _e() |
!$rating | 49–50 | _e(), _e(), esc_attr(), _e(), _e(), _e() |
!$rating | 49–50 | _e(), esc_attr(), _e(), _e(), _e(), _e() |
isset($link) && !$rating | 55–56 | _e(), esc_attr(), _e(), esc_attr(), _e(), _e(), _e() |
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 70 | 43–54 | 6 | 2 fewer instructions than PHP 8.5 |
| 8.5 | 72 | 43–56 | 6 | |
| 8.4 | 72 | 43–56 | 6 | |
| 8.3 | 72 | 43–56 | 6 | |
| 8.2 | 72 | 43–56 | 6 | |
| 8.1 | 72 | 43–56 | 6 | 1 fewer instruction than PHP 7.4 |
| 7.4 | 73 | 43–57 | 6 |
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 · 2
- _e()Displays translated text.
- esc_attr()Escaping for HTML attributes.
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 _e( 'Notes' ); ?></label></th> <td><textarea name="link_notes" id="link_notes" rows="10"><?php echo ( isset( $link->link_notes ) ? $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> <?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.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.9.7 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.