wppaste
WordPress

WP_Posts_List_Table::inline_edit()

Since
3.1.0
Source
wp-admin/includes/class-wp-posts-list-table.php:1617
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_Posts_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
Heavy

Reaches the database via get_post().

Scaling
Scales with input

The body loops, so the work grows with how much data it finds.

Instructions
850

Executed per call on PHP 8.5. The body compiles to 850.

Plugin surface
7 hooks

Third-party callbacks on 'quick_edit_show_taxonomy', 'quick_edit_dropdown_authors_args', 'quick_edit_dropdown_pages_args' 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 callbacksapply_filters()called directly
  • querycontent queryget_post()one call below WP_Posts_List_Table::inline_edit()
  • optionoption read or writeget_option()one call below WP_Posts_List_Table::inline_edit()

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

Across PHP versions

PHPCompiledExecutedBranchesNotes
8.6-dev848848732 fewer instructions than PHP 8.5
8.585085073
8.485085073
8.385085073
8.285085073
8.1850850731 fewer instruction than PHP 7.4
7.485185173

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

7 hooks fire while WP_Posts_List_Table::inline_edit() runs, in this order:

  1. apply_filters( quick_edit_show_taxonomy )filterline 1643 (+26 into the body)

    Filters whether the current taxonomy should be shown in the Quick Edit panel.

  2. apply_filters( quick_edit_dropdown_authors_args )filterline 1758 (+141 into the body)

    Filters the arguments used to generate the Quick Edit authors drop-down.

  3. apply_filters( quick_edit_dropdown_pages_args )filterline 1863 (+246 into the body)

    Filters the arguments used to generate the Quick Edit page-parent drop-down.

  4. apply_filters( default_page_template_title )filterline 1892 (+275 into the body)

    Filters the title of the default page template displayed in the drop-down.

  5. apply_filters( quick_edit_statuses )filterline 2015 (+398 into the body)

    Filters the statuses available in the Quick Edit and Bulk Edit UI.

  6. do_action( bulk_edit_custom_box )actionline 2091 (+474 into the body)

    Fires once for each column in Bulk Edit mode.

  7. do_action( quick_edit_custom_box )actionline 2103 (+486 into the body)

    Fires once for each column in Quick Edit mode.

Uses · 29

Show all 29

Source code

	public function inline_edit() {		global $mode; 		$screen = $this->screen; 		$post             = get_default_post_to_edit( $screen->post_type );		$post_type_object = get_post_type_object( $screen->post_type ); 		$taxonomy_names          = get_object_taxonomies( $screen->post_type );		$hierarchical_taxonomies = array();		$flat_taxonomies         = array(); 		foreach ( $taxonomy_names as $taxonomy_name ) {			$taxonomy = get_taxonomy( $taxonomy_name ); 			$show_in_quick_edit = $taxonomy->show_in_quick_edit; 			/**			 * Filters whether the current taxonomy should be shown in the Quick Edit panel.			 *			 * @since 4.2.0			 *			 * @param bool   $show_in_quick_edit Whether to show the current taxonomy in Quick Edit.			 * @param string $taxonomy_name      Taxonomy name.			 * @param string $post_type          Post type of current Quick Edit post.			 */			if ( ! apply_filters( 'quick_edit_show_taxonomy', $show_in_quick_edit, $taxonomy_name, $screen->post_type ) ) {				continue;			} 			if ( $taxonomy->hierarchical ) {				$hierarchical_taxonomies[] = $taxonomy;			} else {				$flat_taxonomies[] = $taxonomy;			}		} 		$m            = ( isset( $mode ) && 'excerpt' === $mode ) ? 'excerpt' : 'list';		$can_publish  = current_user_can( $post_type_object->cap->publish_posts );		$core_columns = array(			'cb'         => true,			'date'       => true,			'title'      => true,			'categories' => true,			'tags'       => true,			'comments'   => true,			'author'     => true,		);		?> 		<form method="get">		<table style="display: none"><tbody id="inlineedit">		<?php		$hclass              = count( $hierarchical_taxonomies ) ? 'post' : 'page';		$inline_edit_classes = "inline-edit-row inline-edit-row-$hclass";		$bulk_edit_classes   = "bulk-edit-row bulk-edit-row-$hclass bulk-edit-{$screen->post_type}";		$quick_edit_classes  = "quick-edit-row quick-edit-row-$hclass inline-edit-{$screen->post_type}"; 		$bulk = 0; 		while ( $bulk < 2 ) :			$classes  = $inline_edit_classes . ' ';			$classes .= $bulk ? $bulk_edit_classes : $quick_edit_classes;			?>			<tr id="<?php echo $bulk ? 'bulk-edit' : 'inline-edit'; ?>" class="<?php echo $classes; ?>" style="display: none">			<td colspan="<?php echo $this->get_column_count(); ?>" class="colspanchange">			<div class="inline-edit-wrapper" role="region" aria-labelledby="<?php echo $bulk ? 'bulk' : 'quick'; ?>-edit-legend">			<fieldset class="inline-edit-col-left">				<legend class="inline-edit-legend" id="<?php echo $bulk ? 'bulk' : 'quick'; ?>-edit-legend"><?php echo $bulk ? __( 'Bulk Edit' ) : __( 'Quick Edit' ); ?></legend>				<div class="inline-edit-col"> 				<?php if ( post_type_supports( $screen->post_type, 'title' ) ) : ?> 					<?php if ( $bulk ) : ?> 						<div id="bulk-title-div">							<div id="bulk-titles"></div>						</div> 					<?php else : // $bulk ?>

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