[Support request] Why use the plugin “Code Snippets” when Hooks in Elements can be used?

Home Forums Support [Support request] Why use the plugin “Code Snippets” when Hooks in Elements can be used?

Home Forums Support Why use the plugin “Code Snippets” when Hooks in Elements can be used?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2330148
    Lars

    It has been recommended by you to use the plugin Code Snippets if I want to implement PHP-code. The more I get used to using Hooks through Elements I realize that everything, in terms of implementing scripts, can be done through there. So why would I want to use a plugin like Code Snippets at all?

    A curious question. Thanks!

    #2330150
    Fernando
    Customer Support

    Hi Lars,

    Hook Elements in simple terms are actions hooks. They run at specific points as your page loads, depending on which hook you use. In general, you only use this if you’re running code you wish to run at a specific location.

    Otherwise, some code need to run on page load or sometime early as your page loads. If you add a code like add_shortcode in an action hook/hook element, it will be loaded late which may cause issues.

    Simply put it, some code won’t work in Hook Elements.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.