Alter panels panes render arrays and order just before they are rendered

I was reading a blog post this morning and came across a really good piece of advice: use hook_panels_panes_prepared_alter to change the render order of panels panes and also the render arrays themselves, just prior to rendering. I put together a quick code snippet for an example so I won't forget.
<?php
/**
 * Implements hook_panels_panes_prepared_alter().
 */
function examplemodule_panels_panes_prepared_alter(&$panes, panels_renderer_standard $renderer) {
  // Prints out the values using the Search Krumo module.
  sdpm($panes);
  sdpm($renderer);
}
 
?>

Tags

Internal References

External References

Article Type

General