Filter the secondary button attributes.
Arguments
Argument | Type | Description |
---|---|---|
$attributes | Array | Holds the HTML attributes |
$type | String | Button 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 );