| 1 |
<?php |
| 2 |
|
| 3 |
function bogo_get_prop( $prop ) { |
| 4 |
$option = get_option( 'bogo' ); |
| 5 |
|
| 6 |
if ( ! is_array( $option ) ) { |
| 7 |
$option = array(); |
| 8 |
} |
| 9 |
|
| 10 |
return $option[$prop] ?? ''; |
| 11 |
} |
| 12 |
|
| 13 |
|
| 14 |
function bogo_set_prop( $prop, $value ) { |
| 15 |
$option = get_option( 'bogo' ); |
| 16 |
|
| 17 |
if ( ! is_array( $option ) ) { |
| 18 |
$option = array(); |
| 19 |
} |
| 20 |
|
| 21 |
$option[$prop] = $value; |
| 22 |
|
| 23 |
update_option( 'bogo', $option ); |
| 24 |
} |
| 25 |
|
| 26 |
|
| 27 |
function bogo_delete_prop( $prop ) { |
| 28 |
$option = get_option( 'bogo' ); |
| 29 |
|
| 30 |
if ( ! is_array( $option ) ) { |
| 31 |
$option = array(); |
| 32 |
} |
| 33 |
|
| 34 |
if ( isset( $option[$prop] ) ) { |
| 35 |
unset( $option[$prop] ); |
| 36 |
} |
| 37 |
|
| 38 |
update_option( 'bogo', $option ); |
| 39 |
} |
| 40 |
|
| 41 |
|
| 42 |
function bogo_plugin_url( $path = '' ) { |
| 43 |
$url = plugins_url( $path, BOGO_PLUGIN ); |
| 44 |
|
| 45 |
if ( is_ssl() and 'http:' === substr( $url, 0, 5 ) ) { |
| 46 |
$url = 'https:' . substr( $url, 5 ); |
| 47 |
} |
| 48 |
|
| 49 |
return $url; |
| 50 |
} |
| 51 |
|