wppaste
WordPress

WP_Terms_List_Table::inline_edit()

Since
3.1.0
Source
wp-admin/includes/class-wp-terms-list-table.php:675
Outputs the hidden row displayed when inline editing

Compatibility

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

Performance profile

How much work a call to WP_Terms_List_Table::inline_edit() 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 how much data it finds.

Instructions
15–76

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

Plugin surface
1 hook

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

Called by
0

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

What it touches

  • hookthird-party callbacksdo_action()called directly

Further down the call graph this can also reach option, query, cache, serialize 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 · 2 distinct outcomes

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

WhenInstructionsCalls it makes
!current_user_can()15get_taxonomy(), current_user_can()
current_user_can()75–76get_taxonomy(), current_user_can(), ->get_column_count(), _e(), _ex(), _e(), ->get_column_info(), _e(), wp_nonce_field(), esc_attr(), esc_attr(), wp_admin_notice()

Across PHP versions

PHPCompiledExecutedBranchesNotes
8.6-dev9015–764
8.59015–764
8.49015–764
8.39015–764
8.29015–7641 fewer instruction than PHP 8.1
8.19115–774
7.49115–774

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_Terms_List_Table::inline_edit() runs, in this order:

  1. do_action( quick_edit_custom_box )actionline 722 (+47 into the body)

    Fires once for each column in Quick Edit mode.

Uses · 10

  • get_taxonomy()Retrieves the taxonomy object of $taxonomy.
  • current_user_can()Returns whether the current user has the specified capability.
  • _e()Displays translated text.
  • _ex()Displays translated string with gettext context.
  • do_action()Calls the callback functions that have been added to an action hook.
  • wp_nonce_field()Retrieves or display nonce hidden field for forms.
  • esc_attr()Escaping for HTML attributes.
  • wp_admin_notice()Outputs an admin notice.
  • WP_Terms_List_Table::get_column_count()
  • WP_Terms_List_Table::get_column_info()

Source code

	public function inline_edit() {		$tax = get_taxonomy( $this->screen->taxonomy ); 		if ( ! current_user_can( $tax->cap->edit_terms ) ) {			return;		}		?> 		<form method="get">		<table style="display: none"><tbody id="inlineedit"> 			<tr id="inline-edit" class="inline-edit-row" style="display: none">			<td colspan="<?php echo $this->get_column_count(); ?>" class="colspanchange">			<div class="inline-edit-wrapper"> 			<fieldset>				<legend class="inline-edit-legend"><?php _e( 'Quick Edit' ); ?></legend>				<div class="inline-edit-col">				<label>					<span class="title"><?php _ex( 'Name', 'term name' ); ?></span>					<span class="input-text-wrap"><input type="text" name="name" class="ptitle" value="" /></span>				</label> 				<label>					<span class="title"><?php _e( 'Slug' ); ?></span>					<span class="input-text-wrap"><input type="text" name="slug" class="ptitle" value="" /></span>				</label>				</div>			</fieldset> 			<?php			$core_columns = array(				'cb'          => true,				'description' => true,				'name'        => true,				'slug'        => true,				'posts'       => true,			); 			list( $columns ) = $this->get_column_info(); 			foreach ( $columns as $column_name => $column_display_name ) {				if ( isset( $core_columns[ $column_name ] ) ) {					continue;				} 				/** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */				do_action( 'quick_edit_custom_box', $column_name, 'edit-tags', $this->screen->taxonomy );			}			?> 			<div class="inline-edit-save submit">				<button type="button" class="save button button-primary"><?php echo $tax->labels->update_item; ?></button>				<button type="button" class="cancel button"><?php _e( 'Cancel' ); ?></button>				<span class="spinner"></span> 				<?php wp_nonce_field( 'taxinlineeditnonce', '_inline_edit', false ); ?>				<input type="hidden" name="taxonomy" value="<?php echo esc_attr( $this->screen->taxonomy ); ?>" />				<input type="hidden" name="post_type" value="<?php echo esc_attr( $this->screen->post_type ); ?>" /> 				<?php				wp_admin_notice(					'<p class="error"></p>',					array(						'type'               => 'error',						'additional_classes' => array( 'notice-alt', 'inline', 'hidden' ),						'paragraph_wrap'     => false,					)				);				?>			</div>			</div> 			</td></tr> 		</tbody></table>		</form>		<?php	}

Changelog

Introduced in 3.1.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.0.4 tag, from src/wp-admin/includes/class-wp-terms-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.