A WordPress-centric search engine for devs and theme authors



_wp_privacy_account_request_confirmed ›

Since5.0.0
Deprecatedn/a
_wp_privacy_account_request_confirmed ( $result )
Access:
  • private
Parameters:
  • (array) $result Result of the request from the user.
    Required: Yes
Defined at:
Codex:

Update log when privacy request is confirmed.



Source

function _wp_privacy_account_request_confirmed( $result ) {
	if ( isset( $result['action'], $result['request_data'], $result['request_data']['privacy_request_id'] ) && in_array( $result['action'], _wp_privacy_action_request_types(), true ) ) {
		$privacy_request_id = absint( $result['request_data']['privacy_request_id'] );
		$privacy_request    = get_post( $privacy_request_id );

		if ( ! $privacy_request || ! in_array( $privacy_request->post_type, _wp_privacy_action_request_types(), true ) ) {
			return;
		}

		update_post_meta( $privacy_request_id, '_confirmed_timestamp', time() );
		wp_update_post( array(
			'ID'          => $privacy_request_id,
			'post_status' => 'request-confirmed',
		) );
	}
}