A WordPress-centric search engine for devs and theme authors



_wp_privacy_account_request_failed ›

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

Update log when privacy request fails.



Source

function _wp_privacy_account_request_failed( $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;
		}

		wp_update_post( array(
			'ID'          => $privacy_request_id,
			'post_status' => 'request-failed',
		) );
	}
}