customize_render_partials_response

FILTER wp-includes\customize\class-wp-customize-selective-refresh.php (ligne 437) github
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.

Paramètres

Entrée :
$response, $this, $partials
Sortie :
@param array $response {
@param WP_Customize_Selective_Refresh $refresh  Selective refresh component.
@param array                          $partials Placements' context data for the partials rendered in the request.

Utilisation

// Modifier la valeur avec le filtre 'customize_render_partials_response'
add_filter('customize_render_partials_response', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre($response) {
    // Modifier la valeur
    return $response;
}

Actualités

Chargement des actualités...