Support » Themes and Templates » Hooks not changing…..

  • This is an options page for a theme

    So I have this code which essentially is a module to a larger set of code.

    All you have to worry about is lines 55 down.

    So lets see what’s going on, well essentially if a set of fields are not empty, we then go through and set up new functions that echo out those fields and add those functions to add_action then we remove the ones already there.

    Problem number 1:

    If a user changes the text in the text fields this will execute removing the default method associated to this hook. That’s fine, but what if the user changes the text again….what method do I remove then? because I can’t just say oh remove this function, add that one – then – add it again, because the user made another change, oh but remove the non existent function.

    So how would I handle this?

    Problem number 2:

    If a user successfully changes the text in the text area and clicks save then page refreshes and success message is thrown and the text they entered in is the text they see in the text box. How ever if they click off this page – the hook reverts back to the function I am removing, thus displaying that content instead of the content you put in the text area.

    All hooks and there “initial default functions” are being added and created in Aisis Hooks

    All files are then loaded into the functions.php through a set of loaders.

    So essentially, why are the default hooks I created not being removed and the new ones being added? I know I am doing something wrong – just cant figure out what. That and problem number one seems to be eating me alive.

  • The topic ‘Hooks not changing…..’ is closed to new replies.