WP_Terms_List_Table::inline_edit()

In this article

Outputs the hidden row displayed when inline editing

Source

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
}

Hooks

do_action( ‘quick_edit_custom_box’, string $column_name, string $post_type, string $taxonomy )

Fires once for each column in Quick Edit mode.

Changelog

VersionDescription
3.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.