admin管理员组文章数量:1410674
I'm trying to allow users to export their own profile info to a CSV using a link on their profile. Everything works except the $url
path of the link. Here's what I have:
$url = $_GET['uri'];
$nonce = wp_create_nonce( 'download_csv' );
return '<a href="'. $url. '&action=download_csv_bc&_wpnonce='. $nonce.'" class="page-title-action">Export to CSV</a>';
This outputs "/&action=download_csv_bc&_wpnonce=3a9caf44cb" and results in a Page Not Found when clicked.
I can successfully export data from my plugin in the admin area with the following path just fine:
$url = admin_url( 'admin.php?page=myplugin-settings-page' );
But now that I'm trying to export from the front end I'm having issues. I have also tried the following examples which doesn't work either:
$url = admin_url( 'users.php' );
$url = admin_url( 'profile.php' );
(Not sure if it matters, but I am using Ultimate Member for profiles.)
本文标签: phpHow to retrieve current wordpress profile page URL
版权声明:本文标题:php - How to retrieve current wordpress profile page URL? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744946769a2633829.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论