Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

_wp_privacy_completed_request() WordPress Function

The wp_privacy_completed_request function is used to mark a privacy request as complete. This function is useful for keeping track of which privacy requests have been completed and which ones are still pending. It can also be used to display a message to the user indicating that their privacy request has been completed. This function takes two parameters: the ID of the privacy request, and a boolean value indicating whether or not the request was successful. The wp_privacy_completed_request function can be used like this: if ( wp_privacy_completed_request( $request_id, true ) ) { // request was completed successfully } else { // request was not completed successfully }

_wp_privacy_completed_request( int $request_id ) #

Marks a request as completed by the admin and logs the current timestamp.


Parameters

$request_id

(int)(Required)Request ID.


Top ↑

Return

(int|WP_Error) Request ID on success, or a WP_Error on failure.


Top ↑

Source

File: wp-admin/includes/privacy-tools.php

function _wp_privacy_completed_request( $request_id ) {
	// Get the request.
	$request_id = absint( $request_id );
	$request    = wp_get_user_request( $request_id );

	if ( ! $request ) {
		return new WP_Error( 'privacy_request_error', __( 'Invalid personal data request.' ) );
	}

	update_post_meta( $request_id, '_wp_user_request_completed_timestamp', time() );

	$result = wp_update_post(
		array(
			'ID'          => $request_id,
			'post_status' => 'request-completed',
		)
	);

	return $result;
}


Top ↑

Changelog

Changelog
VersionDescription
4.9.6Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.