'day', 'label' => __( 'Day(s)', 'subscription' ), ), array( 'value' => 'week', 'label' => __( 'Week(s)', 'subscription' ), ), array( 'value' => 'month', 'label' => __( 'Month(s)', 'subscription' ), ), array( 'value' => 'year', 'label' => __( 'Year(s)', 'subscription' ), ), ); $access_options = array( array( 'value' => 'lifetime', 'label' => __( 'Never', 'subscription' ), ), array( 'value' => 'full_duration', 'label' => __( 'After full duration', 'subscription' ), ), array( 'value' => 'custom', 'label' => __( 'Custom', 'subscription' ), ), ); global $wp_locale; $weekday_options = array(); for ( $subscrpt_wd = 0; $subscrpt_wd < 7; $subscrpt_wd++ ) { $weekday_options[] = array( 'value' => (string) $subscrpt_wd, 'label' => $wp_locale ? $wp_locale->get_weekday( $subscrpt_wd ) : (string) $subscrpt_wd, ); } // Match the onboarding "Subscription details" form-row styling. $label_style = 'display:block;font-size:13px;font-weight:500;color:var(--wpsubs-text);margin:0 0 7px;'; $row_style = 'margin-bottom:22px;'; $pair_style = 'display:flex;gap:8px;align-items:center;'; /** * Render a field description as a hover tooltip beside the label, so the * descriptions no longer clutter the form as paragraphs. Uses the shared * wpsubs-tooltip component (via wpsubs_render_hint()). * * @param string $text Description text. * @return string Hint markup (already escaped). */ $hint = function ( $text ) { return wpsubs_render_hint( $text ); }; $pro_active = function_exists( 'subscrpt_pro_activated' ) && subscrpt_pro_activated(); $currency = function_exists( 'get_woocommerce_currency_symbol' ) ? html_entity_decode( get_woocommerce_currency_symbol(), ENT_QUOTES, 'UTF-8' ) : '$'; $group_type = isset( $plan['type'] ) ? $plan['type'] : 'recurring'; $is_delivery = 'subscribe_save' === $group_type; $is_installments = 'installments' === $group_type; // The delivery + split-payment fields are Pro. When Pro is inactive (e.g. a // Pro-typed group opened after Pro was deactivated), lock them: a Pro badge on // the label, disabled native inputs, and a non-interactive look on adv-selects. $pro_locked = ! $pro_active; $pro_badge = $pro_locked ? ' ' . esc_html__( 'Pro', 'subscription' ) . '' : ''; $adv_lock = $pro_locked ? 'opacity:0.55;pointer-events:none;' : ''; ?>