-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
39 lines (33 loc) · 1.41 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* Add the options defaults.
*/
function ns_airport_transfers_activate() {
add_option( 'ns-airport-transfers-admin-email', get_option('admin_email') ); // Admin email delivery and contact address
add_option( 'ns-airport-transfers-contact-email', '' ); // Contant email
add_option( 'ns-airport-transfers-contact-phone', '' ); // Contant phone
add_option( 'ns-airport-transfers-country', 'Earthsea' ); // Can be set in plugin's settings page or trough the shortcode
add_option( 'ns-airport-transfers-resort', 'summer' ); // Include ski field or not. Can be set in plugin's settings page or trough the shortcode
add_option( 'ns-airport-transfers-time-format', '24' ); // 12 or 24 Hours time format. Can be set in plugin's settings page or trough the shortcode
}
/**
* Delete the unnecessary options from the database.
*/
function ns_airport_transfers_uninstall() {
delete_option('ns-airport-transfers-admin-email');
delete_option('ns-airport-transfers-contact-email');
delete_option('ns-airport-transfers-contact-phone');
delete_option('ns-airport-transfers-country');
delete_option('ns-airport-transfers-resort');
delete_option('ns-airport-transfers-time-format');
}
/**
* Airport transfers check value.
*
* @param string $string
* @return string
*/
function airport_transfers_check_val( $string='' ) {
$string = ($string!='') ? $string : '-';
return $string;
}