wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



customize_render_partials_response › WordPress Filter Hooks

Da4.5.0
Deprecaton/a
apply_filters( 'customize_render_partials_response', $response, $this, $partials )
Parametri: (3)
  • (array) $response { Response. @type array $contents Associative array mapping a partial ID its corresponding array of contents for the containers requested. @type array $errors List of errors triggered during rendering of partials, if `WP_DEBUG_DISPLAY` is enabled. }
    Richiesto:
  • (WP_Customize_Selective_Refresh) $refresh Selective refresh component.
    Richiesto:
  • (array) $partials 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.
    Richiesto:
Definito a:
Codex:

Filters the response from rendering the partials.

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.





Sorgenti

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