Request::post( 'ttap__enable', $safe ),
'ttap__id' => ( Request::check( 'ttap__id' ) ? sanitize_text_field( $_POST['ttap__id'] ) : '' ),
'boost-robot' => Request::post( 'boost-robot', $safe ),
'boost-alt' => Request::post( 'boost-alt', $safe ),
'ttap-bigta' => Request::post( 'ttap-bigta', $safe ),
'ttap-vidseo' => Request::post( 'ttap-vidseo', $safe ),
'remove_settings' => Request::post( 'remove_settings', $safe ),
];
update_option( 'add-tiktok-advertising-pixel', $options );
// update options
echo '
' . esc_html__( 'Settings saved.', 'add-tiktok-advertising-pixel' ) . '
';
}
$options = new Option();
$notification = new \Pagup\TiktokPixel\Controllers\NotificationController();
echo $notification->support();
//set active class for navigation tabs
$active_tab = ( isset( $_GET['tab'] ) && in_array( $_GET['tab'], $safe ) ? sanitize_key( $_GET['tab'] ) : 'settings' );
//Plugin::dd($_POST);
// var_dump(Option::all());
// purchase notification
$purchase_url = "options-general.php?page=ttap-pricing";
$get_pro = sprintf( wp_kses( __( 'Get Pro version to enable', 'add-tiktok-advertising-pixel' ), array(
'a' => array(
'href' => array(),
'target' => array(),
),
) ), esc_url( $purchase_url ) );
// Return Views
if ( $active_tab == 'settings' ) {
return Plugin::view( 'settings', compact(
'active_tab',
'options',
'get_pro',
'success',
'addon'
) );
}
if ( $active_tab == 'faq' ) {
return Plugin::view( "faq", compact( 'active_tab', 'addon' ) );
}
if ( $active_tab == 'growth-tools' ) {
return Plugin::view( "growth-tools", compact( 'active_tab', 'addon' ) );
}
if ( $addon ) {
if ( $active_tab == 'booster' ) {
return Plugin::view( "tiktok-booster", compact( 'active_tab', 'addon' ) );
}
}
}
}
$settings = new SettingsController();