function hook_ajax_render_alter

Same name in other branches
  1. 9 core/lib/Drupal/Core/Form/form.api.php \hook_ajax_render_alter()
  2. 8.9.x core/lib/Drupal/Core/Form/form.api.php \hook_ajax_render_alter()
  3. 10 core/lib/Drupal/Core/Form/form.api.php \hook_ajax_render_alter()
  4. 11.x core/lib/Drupal/Core/Form/form.api.php \hook_ajax_render_alter()

Alter the commands that are sent to the user through the Ajax framework.

Parameters

$commands: An array of all commands that will be sent to the user.

See also

ajax_render()

Related topics

1 invocation of hook_ajax_render_alter()
ajax_render in includes/ajax.inc
Renders a commands array into JSON.

File

modules/system/system.api.php, line 878

Code

function hook_ajax_render_alter(&$commands) {
    // Inject any new status messages into the content area.
    $commands[] = ajax_command_prepend('#block-system-main .content', theme('status_messages'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.