_wp_privacy_send_request_confirmation_notification( int $request_id )
- Since
- 4.9.6
- Source
wp-includes/user.php:4256
Description
Without this, the admin would have to manually check the site to see if any action was needed on their part yet.
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
$request_idint- The ID of the request.
Performance profile
How much work a call to _wp_privacy_send_request_confirmation_notification() 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
- Expensive
- Scaling
- Constant
- Instructions
- 8–160
- Plugin surface
- 5 hooks
- Called by
- 0
Sends mail via wp_mail().
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 167.
Third-party callbacks on 'user_request_confirmed_email_to', 'user_request_confirmed_email_subject', 'user_confirmed_action_email_content' 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 - optionnetwork option
get_site_option()called directly - mailsends mail
wp_mail()called directly - querycontent query
get_post()one call below _wp_privacy_send_request_confirmation_notification() - cacheobject cache
wp_cache_get()one call below _wp_privacy_send_request_confirmation_notification() - serializeserialisation
maybe_unserialize()one call below _wp_privacy_send_request_confirmation_notification()
Further down the call graph this can also reach transient. That is the worst case, several calls deep and usually down an error path, not what a normal call pays.
What one call costs · 6 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost _wp_privacy_send_request_confirmation_notification() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
| always | 8–11 | wp_get_user_request() |
$request instanceof | 18 | wp_get_user_request(), get_post_meta() |
$request instanceof | 151 | wp_get_user_request(), get_post_meta(), wp_user_request_action_description(), get_site_option(), apply_filters(), get_option(), wp_specialchars_decode(), home_url(), __(), sprintf(), apply_filters(), __(), __(), sprintf(), apply_filters(), sanitize_url(), sanitize_url(), apply_filters(), wp_mail() |
$request instanceof | 153–155 | wp_get_user_request(), get_post_meta(), admin_url(), wp_user_request_action_description(), get_site_option(), apply_filters(), get_option(), wp_specialchars_decode(), home_url(), __(), sprintf(), apply_filters(), __(), __(), sprintf(), apply_filters(), sanitize_url(), sanitize_url(), apply_filters(), wp_mail() |
$request instanceof | 156 | wp_get_user_request(), get_post_meta(), wp_user_request_action_description(), get_site_option(), apply_filters(), get_option(), wp_specialchars_decode(), home_url(), __(), sprintf(), apply_filters(), __(), __(), sprintf(), apply_filters(), sanitize_url(), sanitize_url(), apply_filters(), wp_mail(), update_post_meta() |
$request instanceof | 158–160 | wp_get_user_request(), get_post_meta(), admin_url(), wp_user_request_action_description(), get_site_option(), apply_filters(), get_option(), wp_specialchars_decode(), home_url(), __(), sprintf(), apply_filters(), __(), __(), sprintf(), apply_filters(), sanitize_url(), sanitize_url(), apply_filters(), wp_mail(), update_post_meta() |
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 167 | 8–160 | 6 | |
| 8.5 | 167 | 8–160 | 6 | |
| 8.4 | 167 | 8–160 | 6 | 15 fewer instructions than PHP 8.3 |
| 8.3 | 182 | 8–175 | 6 | |
| 8.2 | 182 | 8–175 | 6 | |
| 8.1 | 182 | 8–175 | 6 | |
| 7.4 | 182 | 8–175 | 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.
Hooks and filters fired · 5
5 hooks fire while _wp_privacy_send_request_confirmation_notification() runs, in this order:
- apply_filters( user_request_confirmed_email_to )filterline 4290 (+34 into the body)
Filters the recipient of the data request confirmation notification.
- apply_filters( user_request_confirmed_email_subject )filterline 4328 (+72 into the body)
Filters the subject of the user request confirmation email.
- do_action( user_confirmed_action_email_content )filter_deprecatedline 4380 (+124 into the body)
Filters the body of the user request confirmation email.
- apply_filters( user_request_confirmed_email_content )filterline 4419 (+163 into the body)
Filters the body of the user request confirmation email.
- apply_filters( user_request_confirmed_email_headers )filterline 4450 (+194 into the body)
Filters the headers of the user request confirmation email.
Uses · 14
- wp_get_user_request()Returns the user request object for the specified request ID.
- get_post_meta()Retrieves a post meta field for the given post ID.
- admin_url()Retrieves the URL to the admin area for the current site.
- wp_user_request_action_description()Gets action description from the name and return a string.
- apply_filters()Calls the callback functions that have been added to a filter hook.
- get_site_option()Retrieve an option value for the current network based on name of option.
- wp_specialchars_decode()Converts a number of HTML entities into their special characters.
- get_option()Retrieves an option value based on an option name.
- home_url()Retrieves the URL for the current site where the front end is accessible.
- __()Retrieves the translation of $text.
- apply_filters_deprecated()Fires functions attached to a deprecated filter hook.
- sanitize_url()Sanitizes a URL for database or redirect usage.
Show all 14
- wp_mail()Sends an email, similar to PHP's mail function.
- update_post_meta()Updates a post meta field based on the given post ID.
Source code
<?phpfunction _wp_privacy_send_request_confirmation_notification( $request_id ) { $request = wp_get_user_request( $request_id ); if ( ! ( $request instanceof WP_User_Request ) || 'request-confirmed' !== $request->status ) { return; } $already_notified = (bool) get_post_meta( $request_id, '_wp_admin_notified', true ); if ( $already_notified ) { return; } if ( 'export_personal_data' === $request->action_name ) { $manage_url = admin_url( 'export-personal-data.php' ); } elseif ( 'remove_personal_data' === $request->action_name ) { $manage_url = admin_url( 'erase-personal-data.php' ); } $action_description = wp_user_request_action_description( $request->action_name ); /** * Filters the recipient of the data request confirmation notification. * * In a Multisite environment, this will default to the email address of the * network admin because, by default, single site admins do not have the * capabilities required to process requests. Some networks may wish to * delegate those capabilities to a single-site admin, or a dedicated person * responsible for managing privacy requests. * * @since 4.9.6 * * @param string $admin_email The email address of the notification recipient. * @param WP_User_Request $request The request that is initiating the notification. */ $admin_email = apply_filters( 'user_request_confirmed_email_to', get_site_option( 'admin_email' ), $request ); $email_data = array( 'request' => $request, 'user_email' => $request->email, 'description' => $action_description, 'manage_url' => $manage_url, 'sitename' => wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), 'siteurl' => home_url(), 'admin_email' => $admin_email, ); $subject = sprintf( /* translators: Privacy data request confirmed notification email subject. 1: Site title, 2: Name of the confirmed action. */ __( '[%1$s] Action Confirmed: %2$s' ), $email_data['sitename'], $action_description ); /** * Filters the subject of the user request confirmation email. * * @since 4.9.8 * * @param string $subject The email subject. * @param string $sitename The name of the site. * @param array $email_data { * Data relating to the account action email. * * @type WP_User_Request $request User request object. * @type string $user_email The email address confirming a request. * @type string $description Description of the action being performed so the user knows what the email is for. * @type string $manage_url The link to click manage privacy requests of this type. * @type string $sitename The site name sending the mail. * @type string $siteurl The site URL sending the mail. * @type string $admin_email The administrator email receiving the mail. * } */ $subject = apply_filters( 'user_request_confirmed_email_subject', $subject, $email_data['sitename'], $email_data ); /* translators: Do not translate SITENAME, USER_EMAIL, DESCRIPTION, MANAGE_URL, SITEURL; those are placeholders. */ $content = __( 'Howdy, A user data privacy request has been confirmed on ###SITENAME###: Changelog
Introduced in 4.9.6. 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-includes/user.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.