<?php

/**
 * @file
 * Functions to support views.
 */

use Drupal\views\ViewExecutable;

/**
 * Implements views_post_render().
 */
function toc_sr_views_post_render(ViewExecutable $view) {
  // This is a simple pass through to namespaced hooks.
  // @see _toc_master_views_post_render__offers_frontend_views__block_1().
  // These should be views.view.theme.inc as they are non-generic.
  $display_id = $view->current_display;
  $view_id = $view->storage->get('id');
  $callback = '_toc_sr_views_post_render__' . $view_id . '__' . $display_id;
  $args = [$view];
  if (function_exists($callback) && is_callable($callback)) {
    $view = call_user_func_array($callback, $args);
  }
}
