Skip to content

Instantly share code, notes, and snippets.

@Luehrsen
Created March 24, 2019 08:13
Show Gist options
  • Save Luehrsen/abd60d92d65cf71cbc513323171138dc to your computer and use it in GitHub Desktop.
Save Luehrsen/abd60d92d65cf71cbc513323171138dc 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