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
/** | |
* 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