Filter the secondary button attributes.


$attributesArrayHolds the HTML attributes
$typeStringButton type
 * Add or filer the secondary button attributes.
 * @param array $attributes Array of HTML atrributes.
 * @param string $type The secondary button type.
function my_prefix_secondary_btn_attributes( $attributes, $type ) {
	if ( 'custom_url' === $type ) {
		$attributes[] = 'target="_blank"';
		$attributes[] = 'rel="nofollow"';
	return $attributes;
add_filter( 'cartpops_secondary_btn_attributes', 'my_prefix_secondary_btn_attributes', 10, 2 );

It's time to improve your WooCommerce Cart

CartPops is a WooCommerce Add To Cart Popup, that helps every shop owner improve their user experience, increase conversions & maximize profits.

Was this page helpful?