---
title: "fswa_normalize_object — Filter Hook"
description: "Converts custom PHP objects in hook arguments into plain arrays for JSON serialization."
url: "https://wpwebhooks.org/docs/fswa-normalize-object/"
---

[WP Webhooks](https://wpwebhooks.org/) / [Docs](https://wpwebhooks.org/docs/) / fswa\_normalize\_object

Filter since v1.5.0

# fswa\_normalize\_object

Converts custom PHP objects in hook arguments into plain arrays for JSON serialization.

/ Signature

```
apply_filters( 'fswa_normalize_object', $data, $object, $class_name )
```

/ When it fires

Fires for each PHP object encountered when serializing WordPress hook arguments to JSON.

/ Parameters

| Name | In | Type | Req | Description |
| --- | --- | --- | --- | --- |
| $data | param | mixed | yes | Current normalized value — \`null\` initially. Return an array to replace the object. |
| $object | param | object | yes | The PHP object to normalize. |
| $class\_name | param | string | yes | Class name of the object (e.g. \`WPCF7\_Submission\`). |

/ Returns

`array|null` Return an array to use as the object's representation. Return \`null\` to skip (plugin's default reflection-based normalization runs).

/ Examples

Normalize a custom form submission object

```
add_filter( 'fswa_normalize_object', function ( $data, $object, $class_name ) {
    if ( $class_name !== 'My_Form_Submission' ) return $data;
    return [
        'form_id' => $object->get_form_id(),
        'fields'  => $object->get_fields(),
    ];
}, 10, 3 );
```

/ Related

[Contact Form 7 Integration](https://wpwebhooks.org/docs/cf7-integration/)[IvyForms Integration](https://wpwebhooks.org/docs/ivyforms-integration/)[fswa\_payload](https://wpwebhooks.org/docs/fswa-payload/)

/Ready

## Your next automation is  
one sentence away.

[Install Plugin→](https://wordpress.org/plugins/flowsystems-webhook-actions/) [See the Plugin →](https://wpwebhooks.org/wordpress-webhook-plugin/)

$ wp plugin install flowsystems-webhook-actions --activate

## Structured data

```json
{"@context":"https://schema.org","@type":"TechArticle","name":"fswa_normalize_object — Filter Hook — Webhook Actions Docs","description":"Converts custom PHP objects in hook arguments into plain arrays for JSON serialization.","url":"https://wpwebhooks.org/docs/fswa-normalize-object/","isPartOf":{"@type":"WebSite","name":"WP Webhooks","url":"https://wpwebhooks.org"},"about":{"@type":"SoftwareApplication","name":"Webhook Actions","applicationCategory":"WordPress Plugin"}}
```
