admin管理员组文章数量:1122832
im trying to secure PDF link when I share the link with someone, below is my functions.php code,
function register_download_brochure_menu() {
add_menu_page(
'Download Brochure',
'Download Brochure',
'manage_options',
'download-brochure',
'display_download_brochure_page',
'dashicons-download', // Icon
25 // Position
);
}
add_action('admin_menu', 'register_download_brochure_menu');
function display_download_brochure_page() {
?>
<div class="wrap">
<h1>Download Brochure</h1>
<form method="get" action="<?php echo home_url('/wp-content/uploads/2024/07/My-LetterPad.pdf'); ?>" target="_blank">
<button type="submit" class="button button-primary">Download Brochure</button>
</form>
</div>
<?php
}
function enqueue_admin_styles() {
wp_enqueue_style('admin-styles', get_template_directory_uri() . '/admin-styles.css');
}
add_action('admin_enqueue_scripts', 'enqueue_admin_styles');
above is my code that display button Download Brochure, and when i click on that button, its open new link, http://localhost/my-project/wp-content/uploads/2024/07/My-LetterPad.pdf, now i copy this link and shared with another user, but here i want, if another user can paste this link in browser, then first its ask for login and then display the pdf URL,
本文标签: urlsHow to secure PDF link when share link to someone
版权声明:本文标题:urls - How to secure PDF link when share link to someone? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736301516a1931202.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论