| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) exit; |
| 3 |
|
| 4 |
/** |
| 5 |
* @param string $context Name of the folder where the code file is placed (tab slug). |
| 6 |
* @param string $setting Name of the file where the code is placed. |
| 7 |
* @return string|false Returns false if settings are empty (shouldn't reach this point in that case anyway), else returns the setting. |
| 8 |
*/ |
| 9 |
function wppb_toolbox_get_settings( $context, $setting ) { |
| 10 |
$option = 'wppb_toolbox_' . $context . '_settings'; |
| 11 |
|
| 12 |
$settings = get_option( $option ); |
| 13 |
|
| 14 |
if ( $settings == false ) return false; |
| 15 |
|
| 16 |
if ( isset( $settings[ $setting ] ) ) |
| 17 |
return $settings[ $setting ]; |
| 18 |
|
| 19 |
return false; |
| 20 |
} |
| 21 |
|