| 1 |
<?php |
| 2 |
/** |
| 3 |
* Freemius |
| 4 |
* |
| 5 |
* @package Copy the Code |
| 6 |
* @since 1.0.0 |
| 7 |
*/ |
| 8 |
|
| 9 |
// Create a helper function for easy SDK access. |
| 10 |
function ctc_fs() { |
| 11 |
global $ctc_fs; |
| 12 |
|
| 13 |
if ( ! isset( $ctc_fs ) ) { |
| 14 |
// Include Freemius SDK. |
| 15 |
require_once COPY_THE_CODE_DIR . 'freemius/start.php'; |
| 16 |
|
| 17 |
$ctc_fs = fs_dynamic_init( |
| 18 |
array( |
| 19 |
'id' => '2780', |
| 20 |
'slug' => 'copy-the-code', |
| 21 |
'type' => 'plugin', |
| 22 |
'public_key' => 'pk_15a174f8c30f506a9a35ccbf0fa76', |
| 23 |
'is_premium' => false, |
| 24 |
'has_addons' => false, |
| 25 |
'has_paid_plans' => false, |
| 26 |
// 'has_affiliation' => 'selected', |
| 27 |
'menu' => array( |
| 28 |
'slug' => 'copy-the-code', |
| 29 |
'override_exact' => true, |
| 30 |
'first-path' => 'options-general.php?page=copy-the-code', |
| 31 |
'network' => true, |
| 32 |
'parent' => array( |
| 33 |
'slug' => 'options-general.php', |
| 34 |
), |
| 35 |
), |
| 36 |
) |
| 37 |
); |
| 38 |
} |
| 39 |
|
| 40 |
return $ctc_fs; |
| 41 |
} |
| 42 |
|
| 43 |
// Init Freemius. |
| 44 |
ctc_fs(); |
| 45 |
// Signal that SDK was initiated. |
| 46 |
do_action( 'ctc_fs_loaded' ); |
| 47 |
|
| 48 |
function ctc_fs_settings_url() { |
| 49 |
return admin_url( 'options-general.php?page=copy-the-code' ); |
| 50 |
} |
| 51 |
|
| 52 |
ctc_fs()->add_filter( 'connect_url', 'ctc_fs_settings_url' ); |
| 53 |
ctc_fs()->add_filter( 'after_skip_url', 'ctc_fs_settings_url' ); |
| 54 |
ctc_fs()->add_filter( 'after_connect_url', 'ctc_fs_settings_url' ); |
| 55 |
ctc_fs()->add_filter( 'after_pending_connect_url', 'ctc_fs_settings_url' ); |
| 56 |
|