Skip to content

Instantly share code, notes, and snippets.

@kreamweb
Created August 25, 2020 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kreamweb/b20a3d21a81ac732635f338870b60b49 to your computer and use it in GitHub Desktop.
Save kreamweb/b20a3d21a81ac732635f338870b60b49 to your computer and use it in GitHub Desktop.
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