WP_Terms_List_Table::column_name( WP_Term $tag ): string
- Source
wp-admin/includes/class-wp-terms-list-table.php:383
Compatibility
- WordPress
- core
- 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
$tagWP_Term- Term object.
Return value
string
Performance profile
How much work a call to WP_Terms_List_Table::column_name() 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
- Scaling
- Constant
- Instructions
- 56–101
- Plugin surface
- 3 hooks
- Called by
- 0
Reaches the database via get_term().
No loop in the body: the same number of instructions runs whatever you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 103.
Third-party callbacks on 'term_name', 'quick_edit_enabled_for_taxonomy', 'editable_slug' run inside this call, and their cost is not bounded by anything here.
Nothing in core calls this; the cost is only what you spend yourself.
What it touches
- hookthird-party callbacks
apply_filters()called directly - querycontent query
get_term()called directly
Further down the call graph this can also reach option, 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 · 8 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost WP_Terms_List_Table::column_name() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
!wp_doing_ajax() | 56 | str_repeat(), apply_filters(), get_term(), wp_doing_ajax(), get_edit_term_link(), apply_filters() |
wp_doing_ajax() | 58 | str_repeat(), apply_filters(), get_term(), wp_doing_ajax(), wp_get_referer(), get_edit_term_link(), apply_filters() |
!wp_doing_ajax() | 77 | str_repeat(), apply_filters(), get_term(), wp_doing_ajax(), get_edit_term_link(), wp_unslash(), urlencode(), add_query_arg(), esc_url(), apply_filters() |
!wp_doing_ajax() | 78 | str_repeat(), apply_filters(), get_term(), wp_doing_ajax(), get_edit_term_link(), apply_filters(), apply_filters() |
wp_doing_ajax() | 79 | str_repeat(), apply_filters(), get_term(), wp_doing_ajax(), wp_get_referer(), get_edit_term_link(), wp_unslash(), urlencode(), add_query_arg(), esc_url(), apply_filters() |
wp_doing_ajax() | 80 | str_repeat(), apply_filters(), get_term(), wp_doing_ajax(), wp_get_referer(), get_edit_term_link(), apply_filters(), apply_filters() |
!wp_doing_ajax() | 99 | str_repeat(), apply_filters(), get_term(), wp_doing_ajax(), get_edit_term_link(), wp_unslash(), urlencode(), add_query_arg(), esc_url(), apply_filters(), apply_filters() |
wp_doing_ajax() | 101 | str_repeat(), apply_filters(), get_term(), wp_doing_ajax(), wp_get_referer(), get_edit_term_link(), wp_unslash(), urlencode(), add_query_arg(), esc_url(), apply_filters(), apply_filters() |
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 102 | 56–100 | 3 | 1 fewer instruction than PHP 8.5 |
| 8.5 | 103 | 56–101 | 3 | |
| 8.4 | 103 | 56–101 | 3 | 5 fewer instructions than PHP 8.3 |
| 8.3 | 108 | 61–106 | 3 | |
| 8.2 | 108 | 61–106 | 3 | |
| 8.1 | 108 | 61–106 | 3 | 1 fewer instruction than PHP 7.4 |
| 7.4 | 109 | 62–106 | 3 |
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 · 3
3 hooks fire while WP_Terms_List_Table::column_name() runs, in this order:
- apply_filters( term_name )filterline 401 (+18 into the body)
Filters display of the term name in the terms list table.
- apply_filters( quick_edit_enabled_for_taxonomy )filterline 428 (+45 into the body)
Filters whether Quick Edit should be enabled for the given taxonomy.
- apply_filters( editable_slug )filterline 435 (+52 into the body)
Filters the editable slug for a post or term.
Uses · 8
- apply_filters()Calls the callback functions that have been added to a filter hook.
- get_term()Gets all term data from database by term ID.
- wp_doing_ajax()Determines whether the current request is a WordPress Ajax request.
- wp_get_referer()Retrieves referer from '_wp_http_referer' or HTTP referer.
- get_edit_term_link()Retrieves the URL for editing a given term.
- add_query_arg()Retrieves a modified URL query string.
- wp_unslash()Removes slashes from a string or recursively removes slashes from strings within an array.
- esc_url()Checks and cleans a URL.
Source code
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">%s</a>', esc_url( $edit_link ), $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; }Changelog
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 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.