WordPress.org

Ready to get started?Download WordPress

Forums

WP Maintenance Mode
Where to place hook script (3 posts)

  1. usableweb
    Member
    Posted 2 years ago #

    Where can I place the hook scripts such that they would not be overwritten by a plugin update? From your example:

    function add_my_link() {
        echo '<a href="http://mylink.com/">My Link</a>
    }
    add_action( 'wm_footer', 'add_my_link' )

    Usually I would place such a thing in my theme's functions.php, but I wasn't sure that this was the correct location for this particular case.

    Thanks!

    http://wordpress.org/extend/plugins/wp-maintenance-mode/

  2. Sebastian Cork
    Member
    Posted 2 years ago #

    Hi usableweb,

    Your theme's function.php is in fact the correct place to place hooks. :)

  3. Sebastian Cork
    Member
    Posted 2 years ago #

    Hi usableweb,

    Your theme's function.php is in fact the correct place and safest place to apply. The concern with doing that, is that if a theme receives an update it's files may be replaced. Although, in that case you would make a child theme.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic