Make a treatment before the action of the form

That’s because you’re using a post action which sends the user to another website. The template_redirect never runs because the user isn’t on your site any more. You’ll need to keep them on the site, register the new user then send them to the gateway with the post data.

admin_notices is not working inside function

Well, this is happening because of hook firing sequence. Hooks actually get loaded from an array(have a look) where admin_notices executes before add_menu_page gets called. Now to show you message in your admin page you can check global $pagenow and the page GET variable by $_GET[‘page’] with an if condition and print your message. Like … Read more

How Do I Unhook This Parent Theme Function?

wp_loaded would fire too early – you can’t remove a hook before it’s been added. I’d try adding your own hook with a higher priority, at the same level as the parent’s hook. That is, not inside an action. add_filter( ‘preprocess_comment’ , ‘my_preprocess_comment_function’, 5 ); Then within your function, remove the parent function: function my_preprocess_comment_function( … Read more

post value to function with Ajax and jQuery

The error is quite self-explanatory. Your last lines are: add_action( ‘wp_ajax_my_action’, ‘my_action_callback’ ); add_filter( ‘wpforms_smart_tag_process’, ‘my_action_callback’, 10, 2 ); The action is calling the same function as the filter. But the filter passes two variables and the action only one. The function itself expects two variables: function my_action_callback($content, $tag) So if you call the function … Read more

Hooking into the HTML header container

Unless a theme provides such a hook there is no way to do this with actions and filters. If a hook is provided then it will be theme specific, no generic WP solution exists. For a full list of the hooks that a theme should implement, see here: https://developer.wordpress.org/themes/advanced-topics/plugin-api-hooks/ At the moment this includes: wp_head() … Read more