Title: customize_render_partials_response
Published: April 12, 2016
Last modified: May 20, 2026

---

# apply_filters( ‘customize_render_partials_response’, array $response, WP_Customize_Selective_Refresh $refresh, array $partials )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/customize_render_partials_response/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/customize_render_partials_response/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/customize_render_partials_response/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/customize_render_partials_response/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/customize_render_partials_response/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/customize_render_partials_response/?output_format=md#wp--skip-link--target)

Filters the response from rendering the partials.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/customize_render_partials_response/?output_format=md#description)󠁿

Plugins may use this filter to inject `$scripts` and `$styles`, which are dependencies
for the partials being rendered. The response data will be available to the client
via the `render-partials-response` JS event, so the client can then inject the scripts
and styles into the DOM if they have not already been enqueued there.

If plugins do this, they’ll need to take care for any scripts that do `document.
write()` and make sure that these are not injected, or else to override the function
to no-op, or else the page will be destroyed.

Plugins should be aware that `$scripts` and `$styles` may eventually be included
by default in the response.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/customize_render_partials_response/?output_format=md#parameters)󠁿

 `$response`array

Response.

 * `contents` array
 * Associative array mapping a partial ID its corresponding array of contents for
   the containers requested.
 * `errors` array
 * List of errors triggered during rendering of partials, if `WP_DEBUG_DISPLAY` 
   is enabled.

`$refresh`[WP_Customize_Selective_Refresh](https://developer.wordpress.org/reference/classes/wp_customize_selective_refresh/)

Selective refresh component.

`$partials`array

Placements’ context data for the partials rendered in the request.
 The array is
keyed by partial ID, with each item being an array of the placements’ context data.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/customize_render_partials_response/?output_format=md#source)󠁿

    ```php
    $response = apply_filters( 'customize_render_partials_response', $response, $this, $partials );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/customize/class-wp-customize-selective-refresh.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/customize/class-wp-customize-selective-refresh.php#L437)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/customize/class-wp-customize-selective-refresh.php#L437-L437)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/customize_render_partials_response/?output_format=md#related)󠁿

| Used by | Description | 
| [WP_Customize_Selective_Refresh::handle_render_partials_request()](https://developer.wordpress.org/reference/classes/wp_customize_selective_refresh/handle_render_partials_request/)`wp-includes/customize/class-wp-customize-selective-refresh.php` |

Handles the Ajax request to return the rendered partials for the requested placements.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/customize_render_partials_response/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fcustomize_render_partials_response%2F)
before being able to contribute a note or feedback.