Last active
January 3, 2024 21:07
-
-
Save KaineLabs/e68fb2a7a031f7e9e4a93d40b14b0af9 to your computer and use it in GitHub Desktop.
Enable Page Login Popup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Enable Page Login Popup | |
function yzc_add_login_page_attribute( $atts, $item, $args ) { | |
if ( is_user_logged_in() ) { | |
return $atts; | |
} | |
// Get Login Page ID. | |
$login_page_id = 1212; | |
// Add Attribute. | |
if ( $item->ID == $login_page_id ) { | |
$atts['data-show-youzify-login'] = 'true'; | |
} | |
return $atts; | |
} | |
add_filter( 'nav_menu_link_attributes', 'yzc_add_login_page_attribute', 999, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not just a link, in the navmenu But a real button with a shortcode or something but than a popup login screen