Proper way of extending the plugin (2 posts)

  1. Spurious
    Posted 2 years ago #


    I got the following task:
    - I want to add a function and an add_action to the functions.php of the current theme
    - The function needs to be dynamically added to the functions.php whenever the main theme is changing

    What's the best way of doing this?


  2. Spurious
    Posted 2 years ago #

    I am currently trying it in a plugin.
    I think long-term, this is the smartest idea.

    I got a question regarding the add_action function.
    Where do I need to put the add_action function within a plugin in order for the action to be executed every time the specific action is called?

    register_activation_hook or will it then only be executed when the plugin is activated?
    I got a plugin_load function that is being called in the plugin code, will this be sufficient?


Topic Closed

This topic has been closed to new replies.

About this Topic