From time to time, I may need to modify certain functions in SP, or more likely, one of its plugins.
I would like to be able to do so in such a way that updates to SP or one of its plugins does not overwrite my customization. In this way, I can evaluate the changes in the new version and decide in an organized fashion whether I can safely remove my customization (obviously, this would be preferred), or if I need to leave it in place or even modify it further.
Apart from filters and action hooks, what is the best practice way to do this in PHP/WordPress/SP?
For example, the file sp-email-post-imap.php contains a function sp_process_inbox_imap(). Let’s assume for discussion that this function is not called as part of a filter or hook chain.
If I wanted to modify sp_process_inbox_imap(), is there a way to do it so that my mods won’t be overridden by future updates to sp-email-post-imap.php?
I am new to PHP & WordPress, so forgive me if this is either a FAQ or an impossibility, but I was thinking along these lines.
Define my own plugin: call it MySPCustomizations and in that plugin redefine the sp_process_inbox_imap() function. If my function is defined after SP’s function, will mine always be called?
Or is there a better way? Appreciate any guidance here!
Thanks!