Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/**
* 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