Skip to content

Instantly share code, notes, and snippets.

@Luehrsen
Created March 24, 2019 08:13
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 Luehrsen/503bf8c5bb57fd0879ce9ca2ac487fbe to your computer and use it in GitHub Desktop.
Save Luehrsen/503bf8c5bb57fd0879ce9ca2ac487fbe to your computer and use it in GitHub Desktop.
/**
* The function that extends the default quicklink options
*
* @param array $options The default Quicklink options.
*
* @return array The extended Quicklink options
*/
function my_extended_quicklink_options( $options ) {
// Do not preload 'add to wishlist' links.
$new_options[] = preg_quote( 'add-to-wishlist=', '/' );
// Remove possible empty strings and duplicates from the array.
$wc_ignores = array_unique( array_filter( $new_options ) );
$options['ignores'] = array_merge( $options['ignores'], $new_options );
return $options;
}
add_filter( 'quicklink_options', 'my_extended_quicklink_options' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment