Created
August 25, 2020 12:02
-
-
Save kreamweb/b20a3d21a81ac732635f338870b60b49 to your computer and use it in GitHub Desktop.
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
if ( ! function_exists( 'yith_pos_customization_show_print_items_link' ) ) { | |
add_action( 'wp_enqueue_scripts', 'yith_pos_customization_show_print_items_link', 99 ); | |
function yith_pos_customization_show_print_items_link() { | |
$js = "wp.hooks.addFilter('yith_pos_header_links', 'yith-pos/customization', (links) => { | |
let newLinks = []; | |
links.forEach( link => { | |
if( link.className === 'register-logout-link' ){ | |
link.show = true; | |
} | |
newLinks.push( link ); | |
}); | |
return newLinks; | |
} );"; | |
wp_add_inline_script( 'yith-pos-frontend', $js, 'before' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment