![]() Hook activity will now be logged in the Activity Log. Perform the action to trigger the action hook point. If you want to do so for pages/posts, just use the shortcode itself (e.g., ), while you can use the do_shortcode('my_shortcode') function anywhere within the template files of your theme or within a function defined in your functions.php. To Check if your Hook is Loading Navigate to Configuration > System Settings > General Settings > Other Tab 1. In order to do this, first create a function inside your functions.php, then add an individual shortcode for this very function, and finally use it anywhere you want. Suppose you want to print a particular text somewhere on your website. ![]() » Shortcodes - Perform tasks anywhere you want It seems, you're mixing up Hooks (i.e., Actions and Filters) and Shortcodes. Hopefully that will give you enough information to evaluate what you need to do and do not need to do, and what you can do, to make this work for your purposes. I think that that is the only way to do it but that has some speed penalties, and will probably have scope issues, especially given that you are executing it inside a class (but I haven't tested that). The core IDE functions also provide a smooth transition from your code editor and allow you to create and maintain different codes with ease. It supports various languages as well as providing options to deploy your code in different WordPress hooks by default. Based on my understanding of hooks, you create a hook, by doing do_action('hook_name') then add something to said hook and call the method where you want it to do the hook, so: public function hook_name()' Īdd_action('funcone','test_new_action_v2') Īdd_action('functwo','test_new_action_v3') CodeKit is one of the most versatile and functional custom codes plugin in the market.
0 Comments
Leave a Reply. |