WP_Privacy_Requests_Table::column_status( WP_User_Request $item ): string|void
- Since
- 4.9.6
- Source
wp-admin/includes/class-wp-privacy-requests-table.php:441
Compatibility
- WordPress
- since 4.9.6
- 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
$itemWP_User_Request- Item being shown.
Return value
string|void- Status column markup. Returns a string if no status is found, otherwise it displays the markup.
Performance profile
How much work a call to WP_Privacy_Requests_Table::column_status() 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
- 13–42
- Plugin surface
- None
- Called by
- 0
Reaches the database via get_post().
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 46.
Nothing here hands control to plugin code.
Nothing in core calls this; the cost is only what you spend yourself.
What it touches
- querycontent query
get_post()one call below WP_Privacy_Requests_Table::column_status() - hookthird-party callbacks
apply_filters()one call below WP_Privacy_Requests_Table::column_status()
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 · 3 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost WP_Privacy_Requests_Table::column_status() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
| always | 13–15 | get_post_status(), get_post_status_object() |
!empty($status_object) && !$item | 31–36 | get_post_status(), get_post_status_object(), esc_attr(), esc_html() |
!empty($status_object) && $item | 37–42 | get_post_status(), get_post_status_object(), esc_attr(), esc_html(), ->get_timestamp_as_date() |
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 46 | 13–42 | 6 | |
| 8.5 | 46 | 13–42 | 6 | |
| 8.4 | 46 | 13–42 | 6 | |
| 8.3 | 46 | 13–42 | 6 | |
| 8.2 | 46 | 13–42 | 6 | 1 more instruction than PHP 8.1 |
| 8.1 | 45 | 13–43 | 6 | |
| 7.4 | 45 | 13–43 | 6 |
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.
Uses · 5
- get_post_status()Retrieves the post status based on the post ID.
- get_post_status_object()Retrieves a post status object by name.
- esc_attr()Escaping for HTML attributes.
- esc_html()Escaping for HTML blocks.
- WP_Privacy_Requests_Table::get_timestamp_as_date()Converts a timestamp for display.
Source code
public function column_status( $item ) { $status = get_post_status( $item->ID ); $status_object = get_post_status_object( $status ); if ( ! $status_object || empty( $status_object->label ) ) { return '-'; } $timestamp = false; switch ( $status ) { case 'request-confirmed': $timestamp = $item->confirmed_timestamp; break; case 'request-completed': $timestamp = $item->completed_timestamp; break; } echo '<span class="status-label status-' . esc_attr( $status ) . '">'; echo esc_html( $status_object->label ); if ( $timestamp ) { echo '<span class="status-date">' . $this->get_timestamp_as_date( $timestamp ) . '</span>'; } echo '</span>'; }Changelog
Introduced in 4.9.6. 2 changes between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
string|void to string|null.verified against sourcestring to string|void.verified against sourceAbout this page
- Parsed data
- Generated from the wordpress-develop 6.9.7 tag, from
src/wp-admin/includes/class-wp-privacy-requests-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.