WP_Terms_List_Table::column_name()publicWP 1.0

Method of the class: WP_Terms_List_Table{}

Return

String.

Usage

$WP_Terms_List_Table = new WP_Terms_List_Table();
$WP_Terms_List_Table->column_name( $tag );
$tag(WP_Term) (required)
Term object.

WP_Terms_List_Table::column_name() code WP 6.5.2

public function column_name( $tag ) {
	$taxonomy = $this->screen->taxonomy;

	$pad = str_repeat( '— ', max( 0, $this->level ) );

	/**
	 * Filters display of the term name in the terms list table.
	 *
	 * The default output may include padding due to the term's
	 * current level in the term hierarchy.
	 *
	 * @since 2.5.0
	 *
	 * @see WP_Terms_List_Table::column_name()
	 *
	 * @param string $pad_tag_name The term name, padded if not top-level.
	 * @param WP_Term $tag         Term object.
	 */
	$name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag );

	$qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' );

	$uri = wp_doing_ajax() ? wp_get_referer() : $_SERVER['REQUEST_URI'];

	$edit_link = get_edit_term_link( $tag, $taxonomy, $this->screen->post_type );

	if ( $edit_link ) {
		$edit_link = add_query_arg(
			'wp_http_referer',
			urlencode( wp_unslash( $uri ) ),
			$edit_link
		);
		$name      = sprintf(
			'<a class="row-title" href="%s" aria-label="%s">%s</a>',
			esc_url( $edit_link ),
			/* translators: %s: Taxonomy term name. */
			esc_attr( sprintf( __( '&#8220;%s&#8221; (Edit)' ), $tag->name ) ),
			$name
		);
	}

	$output = sprintf(
		'<strong>%s</strong><br />',
		$name
	);

	/** This filter is documented in wp-admin/includes/class-wp-terms-list-table.php */
	$quick_edit_enabled = apply_filters( 'quick_edit_enabled_for_taxonomy', true, $taxonomy );

	if ( $quick_edit_enabled ) {
		$output .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
		$output .= '<div class="name">' . $qe_data->name . '</div>';

		/** This filter is documented in wp-admin/edit-tag-form.php */
		$output .= '<div class="slug">' . apply_filters( 'editable_slug', $qe_data->slug, $qe_data ) . '</div>';
		$output .= '<div class="parent">' . $qe_data->parent . '</div></div>';
	}

	return $output;
}