| 1 |
<?php |
| 2 |
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals -- Legacy helper function name kept stable for compatibility. |
| 3 |
/** |
| 4 |
* Shared Getting Started URL for timeline family plugins. |
| 5 |
* |
| 6 |
* @package CoolTimeline |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit; |
| 11 |
} |
| 12 |
|
| 13 |
if ( ! function_exists( 'ctp_timeline_getting_started_url' ) ) { |
| 14 |
/** |
| 15 |
* Build ctl-getting-started URL with the correct onboarding method tab. |
| 16 |
* |
| 17 |
* @param string $plugin_key Plugin key: ctl, ctp, twae, tmdivi, ctlb, cptb. |
| 18 |
* @return string |
| 19 |
*/ |
| 20 |
function ctp_timeline_getting_started_url( $plugin_key = 'ctl' ) { |
| 21 |
$methods = array( |
| 22 |
'ctl' => 'block', |
| 23 |
'ctp' => 'block', |
| 24 |
'ctlb' => 'block', |
| 25 |
'cptb' => 'block', |
| 26 |
'twae' => 'elementor-widget', |
| 27 |
'tmdivi' => 'divi-module', |
| 28 |
); |
| 29 |
|
| 30 |
$method = isset( $methods[ $plugin_key ] ) ? $methods[ $plugin_key ] : 'block'; |
| 31 |
|
| 32 |
return add_query_arg( |
| 33 |
array( |
| 34 |
'page' => 'ctl-getting-started', |
| 35 |
'mode' => 'onboarding', |
| 36 |
'method' => $method, |
| 37 |
), |
| 38 |
admin_url( 'admin.php' ) |
| 39 |
); |
| 40 |
} |
| 41 |
} |
| 42 |
|