* Update translation text domain * Escape everything that should be escaped. * Add nonce checks where needed. * Sanitize all inputs. * Apply Code style changes across the codebase. * Correct many deprecation notices. * Optimize load order of many filters. * Add Proper Build script * Use emojii flags * Fix i18n deprecation notice for translating too early * Put all scripts in footer and load async
51 lines
1.1 KiB
PHP
51 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* Options Functions
|
|
*
|
|
* @package WP_Ultimo\Functions
|
|
* @since 2.0.11
|
|
*/
|
|
|
|
// Exit if accessed directly
|
|
defined('ABSPATH') || exit;
|
|
|
|
/**
|
|
* Get the value of a slugfied network option
|
|
*
|
|
* @param string $option_name Option name.
|
|
* @param mixed $default_value The default value.
|
|
*
|
|
* @return mixed
|
|
*/
|
|
function wu_get_option($option_name = 'settings', $default_value = []) {
|
|
|
|
$option_value = get_network_option(null, wu_slugify($option_name), $default_value);
|
|
|
|
return apply_filters('wu_get_option', $option_value, $option_name, $default_value);
|
|
}
|
|
|
|
/**
|
|
* Save slugfied network option
|
|
*
|
|
* @since 1.9.6
|
|
* @param string $option_name The option name to save.
|
|
* @param mixed $value The new value of the option.
|
|
* @return boolean
|
|
*/
|
|
function wu_save_option($option_name = 'settings', $value = false) {
|
|
|
|
return update_network_option(null, wu_slugify($option_name), $value);
|
|
}
|
|
|
|
/**
|
|
* Delete slugfied network option
|
|
*
|
|
* @since 1.9.6
|
|
* @param string $option_name The option name to delete.
|
|
* @return boolean
|
|
*/
|
|
function wu_delete_option($option_name) {
|
|
|
|
return delete_network_option(null, wu_slugify($option_name));
|
|
}
|