Posted 22 October 2012 - 09:48 PM
I have looked through the Action hooks here:
and watched the hook tutorial here:
The video is talking more about Filters than Actions (using WordPress terminology) and the list of Actions in the api page doesn't show anything that might relate to updating a specific section.
So I have 2 questions:
1. Is there a pre-exisiting Action hook for when a custom section's site wide settings are updated such as through PageLines > Page Options and selecting the section?
2. If not, how can a custom Action hook be added to a section's update?
Posted 23 October 2012 - 04:43 AM
Posted 23 October 2012 - 11:27 AM
Posted 23 October 2012 - 04:26 PM
Posted 23 October 2012 - 04:34 PM
so if the option is footer_text for example, filter will be ploption_footer_text
Its a filter so you MUST pass the option back. You can see it in use here
Posted 23 October 2012 - 04:51 PM
This is how id suggest you do it...
First add an action that hooks into the option_pagelines-special option...when its triggered it can copy the settings you are monitoring to a temp setting. The the next time it is triggered, it can compare the saved 'new' setting with your temp setting ( the old one ), if they are different then fire your API calls.
Posted 23 October 2012 - 07:50 PM
Posted 23 October 2012 - 08:40 PM
Posted 29 October 2012 - 08:03 PM
So to trigger the same function when the the page options for the custom header and footer sections are updated I'd use ?
And if that is correct, how does it know to only trigger when specific page options are changed, i.e. the header and footer options? I was assuming I'd have to add some custom hook to those 2 sections.
Posted 01 November 2012 - 06:21 PM
seems to trigger any time someone navigates to any page options page, not just when an update occurs.
it seems to trigger every time a ploption is pulled to populate the page options page which means it is calls WAY too many times (and has even caused the script to timeout now)
Posted 02 November 2012 - 06:11 PM
didn't work your suggestion lead me in the right direction. The hook I ended up using is
Thanks for pointing me in the right direction
Posted 02 November 2012 - 09:41 PM