mirror of
https://ghproxy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-07-21 12:16:59 +08:00
17 lines
377 B
JavaScript
17 lines
377 B
JavaScript
import { addQueryArgs } from '@wordpress/url';
|
|
|
|
const getDefaultSubscriptionId = () => {
|
|
return window?.ea11ySettingsData?.planData?.subscription?.id;
|
|
};
|
|
|
|
export const getUpgradeLink = (url, subscriptionId = null) => {
|
|
const subId = subscriptionId ?? getDefaultSubscriptionId();
|
|
|
|
if (!subId) {
|
|
return url;
|
|
}
|
|
|
|
return addQueryArgs(url, {
|
|
subscription_id: subId,
|
|
});
|
|
};
|