is_recurring( $args['download_id'] ) ) {
return $args;
}
// Price ID is recurring.
if ( ! empty( $args['price_id'] ) && edd_recurring()->is_price_recurring( $args['download_id'], $args['price_id'] ) ) {
return $args;
}
}
if ( ! empty( $args['direct'] ) ) {
$args['class'] .= ' edd-paypal-checkout-buy-now';
}
return $args;
}
add_filter( 'edd_purchase_link_args', __NAMESPACE__ . '\maybe_add_purchase_link_class' );
/**
* Registers PayPal Commerce JavaScript if using "direct" buy now links.
*
* @param int $download_id ID of the download.
* @param array $args Purchase link arguments.
*
* @since 2.11
*/
function maybe_enable_buy_now_js( $download_id, $args ) {
if ( ! empty( $args['direct'] ) && is_buy_now_enabled() ) {
register_js( true );
$timestamp = time();
?>