admin_post hook not working

You’re missing a ‘ in your code and your function name is different. function my_maybe_add_redirect( $entry, $form ) { wp_redirect( ‘https://www.google.com/’, 301 ); exit(); } add_action( ‘admin_post_submit_images’, ‘my_maybe_add_redirect’, 10, 2 );

Hook with jquery script is not working in wp-admin [closed]

The blank page is a PHP fatal error. You need to either escape the single quotes or change them to double quotes. $(e.target).prop(‘checked’, false); -> $(e.target).prop(“checked”, false); You can enable debugging in WordPress to see the PHP errors by setting WP_DEBUG to true in you wp-config.php file. You can also look in your server/PHP error … Read more

WooCommerce comments_template Filter Not Firing

Okay, for anyone looking to include the WooCommerce review tab not on an actual single-product page here’s the secret sauce: In your template file, you need: global $withcomments; $withcomments = true; Then add a filter for the comments template: //add filter to use our custom review template add_filter(‘comments_template’,'{{YOUR_HELPER_FUNCTION}}’); /** * Hook function for using custom … Read more

change position of element using hook [closed]

Instead of adding and removing the hooks like this. You should do the work on some action/hook. which gets fire before these hooks. so you can call it in this way add_action( ‘init’ , ‘sf_change_header_position’ , 10 ); function sf_change_header_position() { remove_action( ‘storefront_header’, ‘storefront_secondary_navigation’, 30 ); add_action( ‘storefront_header’, ‘storefront_secondary_navigation’, 52 ); }

save_post not working

Try this: add_action( ‘save_post’, ‘vg_update_timestamp’, 0, 1 ); May be this will help… I think i made a little mistake…But i am little confused about priorities… so try this: add_action( ‘save_post’, ‘vg_update_timestamp’, 10, 2 ); Because, Docs says Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order … Read more