admin管理员组文章数量:1425109
I have this inside the <form></form>
:
<input type="hidden" name="action" value="submit_images" data-parsley-excluded />
I have this as my hook just to test:
function maybe_add($entry, $form) {
wp_redirect( '/', 301 );
exit();
}
add_action( 'admin_post_submit_images', maybe_add_', 10, 2 );
I never get redirected to google though no matter what I've tried. Any ideas?
I have this inside the <form></form>
:
<input type="hidden" name="action" value="submit_images" data-parsley-excluded />
I have this as my hook just to test:
function maybe_add($entry, $form) {
wp_redirect( 'https://www.google/', 301 );
exit();
}
add_action( 'admin_post_submit_images', maybe_add_', 10, 2 );
I never get redirected to google though no matter what I've tried. Any ideas?
Share Improve this question edited Jun 6, 2019 at 20:56 nmr 4,5672 gold badges17 silver badges25 bronze badges asked Jun 6, 2019 at 20:50 D.G.D.G. 1 2 |1 Answer
Reset to default 1You're missing a '
in your code and your function name is different.
function my_maybe_add_redirect( $entry, $form ) {
wp_redirect( 'https://www.google/', 301 );
exit();
}
add_action( 'admin_post_submit_images', 'my_maybe_add_redirect', 10, 2 );
本文标签: actionsadminpost hook not working
版权声明:本文标题:actions - admin_post hook not working 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745429743a2658273.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
add_action
– rudtek Commented Jun 6, 2019 at 23:26