Normally, drupal_alter hooks can be implemented by themes as well as modules. However, the invocation of hook_panels_pane_content_alter (plugins/display_renderers/panels_renderer_standard.class.php, line ~570) is done not with drupal_alter, but manually using module_implements(), which does not include themes. I'd like to see if it could either be converted to a drupal_alter or otherwise made compatible with theme implementations.

My use case: We've recently started migrating some of our blocks+Context layouts to Panels. We have a lot of logic in hook_block_view_alter() that automatically adds certain classes within the render array structure. hook_panels_pane_content_alter() would allow us to migrate that logic over without having to rewrite a lot of it (and seems to be one of the few places where you can even get at the render array for the pane content), but I'd rather isolate this hook to the theme where we're doing our migrating rather than put it in a custom module.

Comments

ChaseOnTheWeb created an issue. See original summary.

rooby’s picture

Title: Allow themes to implement hook_panels_pane_content_alter() » hook_panels_pane_content_alter() doesn't use drupal_alter()
Category: Feature request » Bug report

I suggest this is a bug, since *_alter() functions are supposed to be implemented by themes but in this case it doesn't act as expected because the code uses module_implements() instead of drupal_alter().