I am developing a page in WordPress. In functions.php
file I have this:
function feed_add_notmusa() {
add_feed('mypage', 'mypage_function');
}
function mypage_function() {
get_template_part('/mypage');
}
But how can I restrict access to /mypage
so only logged in users can access?
Could you please help me?
get_template_part
doesn't take a URL path as a parameter, it takes a php template file name, the/
is not needed. It will try to loadchildtheme/mypage.php
and thenparenttheme/mypage.php
if it doesn't exist