function be_header_menu_desc( $item_output, $item, $depth, $args ) { if ( 'main_menu' == $args->theme_location && !…
Redirect CPT for non-logged-in users
Now you can make a certain Custom Post Type invisible for guest and only accessible for registered and logged-in users. Adapt as you like this following snippet:
function hide_single_property() {
if( is_singular('patterns-nr') || is_page('dashboard')) {
if( ! is_user_logged_in() ) {
wp_redirect(get_permalink(9600),302);
//wp_redirect( 'https://pro.visual-bp.de/nicht-eingeloggt/', 301 );
exit;
}
}
}
add_action('template_redirect','hide_single_property');
Dieser Beitrag hat 0 Kommentare