admin管理员组文章数量:1130349
My goal is to allow users to delete posts they own from the front end. I have an API that returns some JSON along with a link to delete their post.
$delLink = wp_nonce_url( site_url() . "/wp-admin/post.php?action=trash&post=" . $post->ID, 'trash-' . $post->post_type . '_' . $post->ID);
This does return a url with a nonce
.php?post=338&action=trash&_wpnonce=983403d085
If I click this link it brings me to the 'posts' section of my admin panel without deleting the custom post in question.
But if I compare that to the link in my admin panel, the URL should be
.php?post=338&action=trash&_wpnonce=7337993b16
What am I doing wrong here?
My goal is to allow users to delete posts they own from the front end. I have an API that returns some JSON along with a link to delete their post.
$delLink = wp_nonce_url( site_url() . "/wp-admin/post.php?action=trash&post=" . $post->ID, 'trash-' . $post->post_type . '_' . $post->ID);
This does return a url with a nonce
.php?post=338&action=trash&_wpnonce=983403d085
If I click this link it brings me to the 'posts' section of my admin panel without deleting the custom post in question.
But if I compare that to the link in my admin panel, the URL should be
.php?post=338&action=trash&_wpnonce=7337993b16
What am I doing wrong here?
本文标签: noncewpnonceurl generating invalid links
版权声明:本文标题:nonce - wp_nonce_url generating invalid links 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749076256a2312352.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论