I'm writing a routine to track inline image usage in panel panes every time the panels content form is submitted. The hook_panels_pane_update hook works, but only after the second time the form is saved. Is there a hook that will trigger the first time the form is saved?
1 Answer
Correct, according to the panels.api.php
file, hook_panels_pane_update() is for changed panes. There's one just above it for new panes called hook_panels_pane_insert().
If you want the same function to happen every time regardless of whether the pane is new or not, combine them like this:
function mymodule_panels_pane_insert($pane){
mymodule_act_on_panels($pane);
}
function mymodule_panels_pane_update($pane){
mymodule_act_on_panels($pane);
}
function mymodule_act_on_panels($pane){
//Do the things here
}