Created
June 15, 2016 18:03
-
-
Save jaygidwitz/e15b3047db0e3af004e2fe47976196da to your computer and use it in GitHub Desktop.
Add custom lightbox attribute to menu item optin monster.
This file contains hidden or 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
/* Add custom lightbox attribute to the menu Optin Monster | |
*/ | |
function prefix_menu_item_extra_atts( $atts, $item, $args ) | |
{ | |
if ( $item->object_id == '652') { | |
$atts['data-optin-slug'] = 'uc20zebirdm018gi'; | |
$atts['class'] = 'manual-optin-trigger'; | |
} | |
return $atts; | |
} | |
add_filter( 'nav_menu_link_attributes', 'prefix_menu_item_extra_atts', 10, 3 ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment