Exemplo n.º 1
0
/**
 * Set extension's setting option value in database
 *
 * @param string $extension_name
 * @param string|null $option_id
 * @param mixed $value
 */
function fw_set_db_ext_settings_option($extension_name, $option_id = null, $value)
{
    if (!fw()->extensions->get($extension_name)) {
        trigger_error('Invalid extension: ' . $extension_name, E_USER_WARNING);
        return;
    }
    FW_WP_Option::set('fw_ext_settings_options:' . $extension_name, $option_id, $value);
}
 public function set_favorites($favorites)
 {
     FW_WP_Option::set($this->key, 'type', $favorites);
 }
Exemplo n.º 3
0
/**
 * Set some extension's data in database
 *
 * @param string $extension_name Name of the extension that owns the data
 * @param string|null $multi_key The key of the data you want to set. null - all data
 * @param mixed $value
 */
function fw_set_db_extension_data($extension_name, $multi_key = null, $value)
{
    if (!fw()->extensions->get($extension_name)) {
        trigger_error('Invalid extension: ' . $extension_name, E_USER_WARNING);
        return;
    }
    if ($multi_key) {
        $multi_key = $extension_name . '/' . $multi_key;
    } else {
        $multi_key = $extension_name;
    }
    FW_WP_Option::set('fw_extensions', $multi_key, $value);
}
Exemplo n.º 4
0
 protected function set_values($item_id, $values, array $extra_data = array())
 {
     FW_WP_Option::set('fw_ext_settings_options:' . $item_id, null, $values);
 }