• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP fw_get_options_values_from_input函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中fw_get_options_values_from_input函数的典型用法代码示例。如果您正苦于以下问题:PHP fw_get_options_values_from_input函数的具体用法?PHP fw_get_options_values_from_input怎么用?PHP fw_get_options_values_from_input使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了fw_get_options_values_from_input函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _settings_form_save

 public function _settings_form_save($data)
 {
     fw_set_db_settings_option(null, array_merge((array) fw_get_db_settings_option(), fw_get_options_values_from_input(fw()->theme->get_settings_options())));
     FW_Flash_Messages::add('fw_settings_form_saved', __('Options successfuly saved', 'fw'), 'success');
     $data['redirect'] = fw_current_url();
     return $data;
 }
开发者ID:halkibsi,项目名称:Unyson,代码行数:7,代码来源:backend.php


示例2: _get_value_from_input

 /**
  * @internal
  *
  * @param array $option
  * @param array|null|string $input_value
  *
  * @return array|bool|int|string
  */
 protected function _get_value_from_input($option, $input_value)
 {
     if (is_array($input_value) && !empty($input_value)) {
         fw_ext('mailer')->set_db_settings_option(null, fw_get_options_values_from_input($this->get_inner_options(), $input_value));
     }
     return fw_ext('mailer')->get_db_settings_option();
 }
开发者ID:chrisuehlein,项目名称:couponsite,代码行数:15,代码来源:class-fw-option-type-mailer.php


示例3: enqueue_static

 public function enqueue_static()
 {
     wp_enqueue_style('fw-builder-' . $this->get_builder_type() . '-item-' . $this->get_type(), $this->get_uri('/static/css/styles.css'));
     wp_enqueue_script('fw-builder-' . $this->get_builder_type() . '-item-' . $this->get_type(), $this->get_uri('/static/js/scripts.js'), array('fw-events'), false, true);
     wp_localize_script('fw-builder-' . $this->get_builder_type() . '-item-' . $this->get_type(), 'fw_form_builder_item_type_' . $this->get_type(), array('options' => $this->get_options(), 'l10n' => array('item_title' => __('Recaptcha', 'fw'), 'label' => __('Label', 'fw'), 'edit_label' => __('Edit Label', 'fw'), 'edit' => __('Edit', 'fw'), 'delete' => __('Delete', 'fw'), 'site_key' => __('Set site key', 'fw'), 'secret_key' => __('Set secret key', 'fw')), 'defaults' => array('type' => $this->get_type(), 'options' => fw_get_options_values_from_input($this->get_options(), array()))));
     fw()->backend->enqueue_options_static($this->get_options());
 }
开发者ID:HilderH,项目名称:emprendamos,代码行数:7,代码来源:class-fw-option-type-form-builder-item-recaptcha.php


示例4: _form_save

 /**
  * @internal
  */
 public function _form_save($data)
 {
     fw_set_db_extension_data($this->get_name(), 'options', fw_get_options_values_from_input($this->get_settings_options()));
     do_action('fw_' . $this->get_name() . '_form_save');
     $data['redirect'] = fw_current_url();
     return $data;
 }
开发者ID:AdsonCicilioti,项目名称:Unyson,代码行数:10,代码来源:class-fw-extension-styling.php


示例5: _admin_action_wp_ajax_backup_settings_save

 /**
  * @internal
  */
 public function _admin_action_wp_ajax_backup_settings_save()
 {
     if (!current_user_can('manage_options')) {
         wp_send_json_error();
     }
     $settings = $this->backup()->settings();
     $values = fw_get_options_values_from_input($settings->get_options(), FW_Request::POST('values'));
     $settings->save($values);
     wp_send_json_success();
 }
开发者ID:chrisuehlein,项目名称:couponsite,代码行数:13,代码来源:class-fw-backup-ajax.php


示例6: get_fixed_attributes

 protected function get_fixed_attributes($attributes)
 {
     // do not allow sub items
     unset($attributes['_items']);
     $default_attributes = array('type' => $this->get_type(), 'shortcode' => false, 'width' => '', 'options' => array());
     // remove unknown attributes
     $attributes = array_intersect_key($attributes, $default_attributes);
     $attributes = array_merge($default_attributes, $attributes);
     $attributes['options'] = fw_get_options_values_from_input($this->get_options(), $attributes['options']);
     return $attributes;
 }
开发者ID:alireza--noori,项目名称:initial-portfolio-website-test-,代码行数:11,代码来源:class-fw-option-type-form-builder-item-email.php


示例7: get_fixed_attributes

 protected function get_fixed_attributes($attributes)
 {
     // do not allow sub items
     unset($attributes['_items']);
     $default_attributes = array('type' => $this->get_type(), 'shortcode' => false, 'width' => '', 'options' => array());
     // remove unknown attributes
     $attributes = array_intersect_key($attributes, $default_attributes);
     $attributes = array_merge($default_attributes, $attributes);
     $attributes['options'] = fw_get_options_values_from_input($this->get_options(), $attributes['options']);
     $constraints = $attributes['options']['constraints'];
     if (!empty($constraints['constraint'])) {
         $constraint = $constraints['constraint'];
         $constraint_data = $constraints[$constraint];
         switch ($constraint) {
             case 'digits':
                 if (!empty($constraint_data['min'])) {
                     $constraint_data['min'] = intval($constraint_data['min']);
                     if ($constraint_data['min'] < 0) {
                         $constraint_data['min'] = 0;
                     }
                 }
                 if (!empty($constraint_data['max'])) {
                     $constraint_data['max'] = intval($constraint_data['max']);
                     if ($constraint_data['max'] < 0 || $constraint_data['max'] < $constraint_data['min']) {
                         $constraint_data['max'] = null;
                     }
                 }
                 break;
             case 'value':
                 if ($constraint_data['min'] === '' || !preg_match($this->number_regex, $constraint_data['min'])) {
                     $constraint_data['min'] = null;
                 } else {
                     $constraint_data['min'] = doubleval($constraint_data['min']);
                 }
                 if ($constraint_data['max'] === '' || !preg_match($this->number_regex, $constraint_data['max'])) {
                     $constraint_data['max'] = null;
                 } else {
                     $constraint_data['max'] = doubleval($constraint_data['max']);
                 }
                 if (!is_null($constraint_data['max']) && !is_null($constraint_data['min'])) {
                     if ($constraint_data['max'] < $constraint_data['min']) {
                         $constraint_data['max'] = null;
                     }
                 }
                 break;
             default:
                 trigger_error('Invalid constraint: ' . $constraint, E_USER_WARNING);
                 $attributes['options']['constraints']['constraint'] = '';
         }
         $attributes['options']['constraints'][$constraint] = $constraint_data;
     }
     return $attributes;
 }
开发者ID:alireza--noori,项目名称:initial-portfolio-website-test-,代码行数:53,代码来源:class-fw-option-type-form-builder-item-number.php


示例8: setting_sanitize_callback

 public function setting_sanitize_callback($input)
 {
     $input = json_decode($input, true);
     if (is_null($input)) {
         return null;
     }
     $POST = array();
     foreach ($input as $var) {
         fw_aks(fw_html_attr_name_to_array_multi_key($var['name']), $var['value'], $POST);
     }
     $value = fw_get_options_values_from_input(array($this->id => $this->fw_option), fw_akg(FW_Option_Type::get_default_name_prefix(), $POST));
     $value = array_pop($value);
     return $value;
 }
开发者ID:alireza--noori,项目名称:initial-portfolio-website-test-,代码行数:14,代码来源:class--fw-customizer-control-option-wrapper.php


示例9: get_fixed_attributes

 protected function get_fixed_attributes($attributes)
 {
     // do not allow sub items
     unset($attributes['_items']);
     $default_attributes = array('type' => $this->get_type(), 'shortcode' => false, 'width' => '', 'options' => array());
     // remove unknown attributes
     $attributes = array_intersect_key($attributes, $default_attributes);
     $attributes = array_merge($default_attributes, $attributes);
     $only_options = array();
     foreach (fw_extract_only_options($this->get_options()) as $option_id => $option) {
         if (array_key_exists($option_id, $attributes['options'])) {
             $option['value'] = $attributes['options'][$option_id];
         }
         $only_options[$option_id] = $option;
     }
     $attributes['options'] = fw_get_options_values_from_input($only_options, array());
     unset($only_options, $option_id, $option);
     $constraints = $attributes['options']['constraints'];
     if (!empty($constraints['constraint'])) {
         $constraint = $constraints['constraint'];
         $constraint_data = $constraints[$constraint];
         switch ($constraint) {
             case 'characters':
             case 'words':
                 if (!empty($constraint_data['min'])) {
                     $constraint_data['min'] = intval($constraint_data['min']);
                     if ($constraint_data['min'] < 0) {
                         $constraint_data['min'] = 0;
                     }
                 }
                 if (!empty($constraint_data['max'])) {
                     $constraint_data['max'] = intval($constraint_data['max']);
                     if ($constraint_data['max'] < 0 || $constraint_data['max'] < $constraint_data['min']) {
                         $constraint_data['max'] = null;
                     }
                 }
                 break;
             default:
                 trigger_error('Invalid constraint: ' . $constraint, E_USER_WARNING);
                 $attributes['options']['constraints']['constraint'] = '';
         }
         $attributes['options']['constraints'][$constraint] = $constraint_data;
     }
     return $attributes;
 }
开发者ID:HilderH,项目名称:emprendamos,代码行数:45,代码来源:class-fw-option-type-form-builder-item-textarea.php


示例10: get_fixed_attributes

 protected function get_fixed_attributes($attributes)
 {
     // do not allow sub items
     unset($attributes['_items']);
     $default_attributes = array('type' => $this->get_type(), 'shortcode' => 'form-header-title', 'width' => '', 'options' => array());
     // remove unknown attributes
     $attributes = array_intersect_key($attributes, $default_attributes);
     $attributes = array_merge($default_attributes, $attributes);
     $only_options = array();
     foreach (fw_extract_only_options($this->get_options()) as $option_id => $option) {
         if (array_key_exists($option_id, $attributes['options'])) {
             $option['value'] = $attributes['options'][$option_id];
         }
         $only_options[$option_id] = $option;
     }
     $attributes['options'] = fw_get_options_values_from_input($only_options, array());
     unset($only_options, $option_id, $option);
     return $attributes;
 }
开发者ID:northpen,项目名称:northpen,代码行数:19,代码来源:class-fw-option-type-form-builder-item-form-header-title.php


示例11: _action_ajax_cache_slide

 /**
  * @internal
  */
 public static function _action_ajax_cache_slide()
 {
     $output = '';
     $attr_data = json_decode(FW_Request::POST('option'), true);
     $option = $attr_data['option'];
     $id = $attr_data['id'];
     $data = $attr_data['data'];
     parse_str(FW_Request::POST('values'), $values);
     if (isset($values)) {
         $options_values_cache = $values['fw_options']['custom-slides'];
         $options_values = array_pop($options_values_cache);
         $valid_values = fw_get_options_values_from_input($option['slides_options'], $options_values);
         foreach ($values['fw_options']['custom-slides'] as $key => $value) {
             $output .= "<div class='fw-slide slide-" . $key . "'  data-order='" . $key . "'>";
             $output .= fw()->backend->render_options($option['slides_options'], $valid_values, array('id_prefix' => $data['id_prefix'] . $id . '-' . $key . '-', 'name_prefix' => $data['name_prefix'] . '[' . $id . '][' . $key . ']'));
             $output .= "</div>";
         }
     }
     wp_send_json($output);
 }
开发者ID:Archrom,项目名称:wordpress_remaf,代码行数:23,代码来源:class-fw-option-type-slides.php


示例12: _get_value_from_input

 /**
  * @internal
  */
 protected function _get_value_from_input($option, $input_value)
 {
     if (is_null($input_value)) {
         return $option['value'];
     } else {
         $value = fw_get_options_values_from_input($this->internal_options, $input_value);
         //remove time, if all_day selected
         $all_day = fw_akg('event_durability', $value);
         if ($all_day === 'yes') {
             foreach ($value['event_datetime'] as $key => &$row) {
                 if (isset($row['event_date_range']['from'])) {
                     $row['event_date_range']['from'] = date($this->only_date_format, strtotime($row['event_date_range']['from']));
                 }
                 if (isset($row['event_date_range']['to'])) {
                     $row['event_date_range']['to'] = date($this->only_date_format, strtotime($row['event_date_range']['to']));
                 }
             }
         }
         return $value;
     }
 }
开发者ID:Code-Divine,项目名称:Dunda-Events-Extension,代码行数:24,代码来源:class-fw-option-type-event.php


示例13: _get_value_from_input

 /**
  * @internal
  *
  * @param array $option
  * @param array|null|string $input_value
  *
  * @return array|bool|int|string
  */
 protected function _get_value_from_input($option, $input_value)
 {
     if (is_array($input_value) && !empty($input_value)) {
         /**
          * Doing a database save in get_value_from_input() is wrong
          * because this is not an actual save.
          * But this option type use is limited, it's used only in one place
          * and it works, so we decided to not create a new "deep save trigger" mechanism
          * just for one option.
          * When such mechanism will be needed for general use, then we will figure out something.
          */
         fw_ext('mailer')->set_db_settings_option(null, fw_get_options_values_from_input($this->get_inner_options(), $input_value));
     }
     /**
      * Return "nothing"
      * Prevent private smtp data to be saved/duplicated in post meta (somewhere else)
      */
     return array('time' => time());
 }
开发者ID:northpen,项目名称:northpen,代码行数:27,代码来源:class-fw-option-type-mailer.php


示例14: _get_value_from_input

 /**
  * Extract correct value for $option['value'] from input array
  * If input value is empty, will be returned $option['value']
  *
  * @param array $option
  * @param array|string|null $input_value
  *
  * @return string|array|int|bool Correct value
  * @internal
  */
 protected function _get_value_from_input($option, $input_value)
 {
     if (empty($input_value)) {
         if (empty($option['popup-options'])) {
             return array();
         }
         /**
          * $option['value'] has DB format (not $input_value HTML format)
          * so it can't be used as second parameter in fw_get_options_values_from_input()
          * thus we need to move each option value in option array default values
          */
         $popup_options = array();
         foreach (fw_extract_only_options($option['popup-options']) as $popup_option_id => $popup_option) {
             if (isset($option['value'][$popup_option_id])) {
                 $popup_option['value'] = $option['value'][$popup_option_id];
             }
             $popup_options[$popup_option_id] = $popup_option;
         }
         $values = fw_get_options_values_from_input($popup_options, array());
     } else {
         if (is_array($input_value)) {
             /**
              * Don't decode if we have already an array
              */
             $values = fw_get_options_values_from_input($option['popup-options'], $input_value);
         } else {
             $values = fw_get_options_values_from_input($option['popup-options'], json_decode($input_value, true));
         }
     }
     return $values;
 }
开发者ID:puriwp,项目名称:Theme-Framework,代码行数:41,代码来源:class-fw-option-type-popup.php


示例15: fw_get_db_ext_settings_option

/**
 * Get extension's settings option value from the database
 *
 * @param string $extension_name
 * @param string|null $option_id
 * @param null|mixed $default_value If no option found in the database, this value will be returned
 * @param null|bool $get_original_value Original value is that with no translations and other changes
 *
 * @return mixed|null
 */
function fw_get_db_ext_settings_option($extension_name, $option_id = null, $default_value = null, $get_original_value = null)
{
    if (!($extension = fw()->extensions->get($extension_name))) {
        trigger_error('Invalid extension: ' . $extension_name, E_USER_WARNING);
        return null;
    }
    $value = FW_WP_Option::get('fw_ext_settings_options:' . $extension_name, $option_id, $default_value, $get_original_value);
    if (is_null($value)) {
        /**
         * Maybe the options was never saved or the given option id does not exists
         * Extract the default values from the options array and try to find there the option id
         */
        $cache_key = 'fw_default_options_values/ext_settings:' . $extension_name;
        try {
            $all_options_values = FW_Cache::get($cache_key);
        } catch (FW_Cache_Not_Found_Exception $e) {
            // extract the default values from options array
            $all_options_values = fw_get_options_values_from_input($extension->get_settings_options(), array());
            FW_Cache::set($cache_key, $all_options_values);
        }
        if (empty($option_id)) {
            // option id not specified, return all options values
            return $all_options_values;
        } else {
            return fw_akg($option_id, $all_options_values, $default_value);
        }
    } else {
        return $value;
    }
}
开发者ID:floq-design,项目名称:Unyson,代码行数:40,代码来源:database.php


示例16: _action_admin_save_shortcodes

 public function _action_admin_save_shortcodes($post_id, $post)
 {
     if (wp_is_post_autosave($post_id)) {
         $original_id = wp_is_post_autosave($post_id);
         $original_post = get_post($original_id);
     } else {
         if (wp_is_post_revision($post_id)) {
             $original_id = wp_is_post_revision($post_id);
             $original_post = get_post($original_id);
         } else {
             $original_id = $post_id;
             $original_post = $post;
         }
     }
     if (!$this->is_supported_post($original_id) || !post_type_supports($original_post->post_type, $this->get_parent()->get_supports_feature_name())) {
         return false;
     }
     // todo: field 'content' smth changes ?
     $post_content = FW_Request::POST('content');
     // {"notification":{"1":{"message":"Message!","type":""}},"button":{"1":{},"2":{}},"text_block":{"1":{}}}
     $input_value = FW_Request::POST($this->meta_key);
     $tmp_val = json_decode($input_value, true);
     $new_val = array();
     // supported shortcodes
     $tags = implode('|', array_keys(fw_ext('shortcodes')->get_shortcodes()));
     $default_values = array();
     // only supported tags & integer\alphabetic string id
     if (preg_match_all('/\\[(' . $tags . ')(?:\\s+[^\\[\\]]*)fw_shortcode_id=[\\"\']([A-Za-z0-9]+)[\\"\'](?:\\s?[^\\[\\]]*)\\]/', $post_content, $output_array)) {
         foreach ($output_array[0] as $match_key => $match) {
             $tag = $output_array[1][$match_key];
             $id = $output_array[2][$match_key];
             if (!isset($tmp_val[$tag]) || !isset($tmp_val[$tag][$id]) || empty($tmp_val[$tag][$id])) {
                 $shortcode = fw_ext('shortcodes')->get_shortcode($tag);
                 if ($shortcode) {
                     $new_val[$tag][$id] = fw_get_options_values_from_input($shortcode->get_options(), array());
                 }
             } elseif (isset($tmp_val[$tag][$id]) and false === empty($tmp_val[$tag][$id])) {
                 $new_val[$tag][$id] = $tmp_val[$tag][$id];
             }
         }
     }
     // only supported tags match (defaults)
     if (preg_match_all('/\\[(' . $tags . ')(?:\\s+[^\\[\\]]*).*(?:\\s?[^\\[\\]]*)\\]/', $post_content, $output_array)) {
         foreach ($output_array[0] as $match_key => $match) {
             $tag = $output_array[1][$match_key];
             $shortcode = fw_ext('shortcodes')->get_shortcode($tag);
             if (!empty($shortcode) && is_array($shortcode->get_options())) {
                 $default_values[$tag] = fw_get_options_values_from_input($shortcode->get_options(), array());
             }
         }
     }
     update_post_meta($post_id, $this->meta_key_defaults, str_replace('\\', '\\\\', json_encode($default_values)));
     update_post_meta($post_id, $this->meta_key, str_replace('\\', '\\\\', json_encode($new_val)));
     return true;
 }
开发者ID:ExtPoint,项目名称:Unyson-PageBuilder-Extension,代码行数:55,代码来源:class-fw-extension-editor-shortcodes.php


示例17: fw_get_db_customizer_option

/**
 * Get a customizer framework option value from the database
 *
 * @param string|null $option_id Specific option id (accepts multikey). null - all options
 * @param null|mixed $default_value If no option found in the database, this value will be returned
 * // fixme: Maybe add this parameter? @ param null|bool $get_original_value Original value is that with no translations and other changes
 *
 * @return mixed|null
 */
function fw_get_db_customizer_option($option_id = null, $default_value = null)
{
    // note: this contains only changed controls/options
    $all_db_values = get_theme_mod(FW_Option_Type::get_default_name_prefix(), array());
    $cache_key = 'fw_default_options_values/customizer';
    try {
        $all_default_values = FW_Cache::get($cache_key);
    } catch (FW_Cache_Not_Found_Exception $e) {
        // extract the default values from options array
        $all_default_values = fw_get_options_values_from_input(fw()->theme->get_customizer_options(), array());
        FW_Cache::set($cache_key, $all_default_values);
    }
    if (is_null($option_id)) {
        return array_merge($all_default_values, $all_db_values);
    } else {
        $base_key = explode('/', $option_id);
        // note: option_id can be a multi-key 'a/b/c'
        $base_key = array_shift($base_key);
        $all_db_values = array_key_exists($base_key, $all_db_values) ? $all_db_values : $all_default_values;
        return fw_akg($option_id, $all_db_values, $default_value);
    }
}
开发者ID:alireza--noori,项目名称:initial-portfolio-website-test-,代码行数:31,代码来源:database.php


示例18: _extension_settings_form_save

 /**
  * @param array $data
  * @return array
  * @internal
  */
 public function _extension_settings_form_save($data)
 {
     $extension = fw()->extensions->get(FW_Request::POST('fw_extension_name'));
     $options_before_save = (array) fw_get_db_ext_settings_option($extension->get_name());
     fw_set_db_ext_settings_option($extension->get_name(), null, array_merge($options_before_save, fw_get_options_values_from_input($extension->get_settings_options())));
     FW_Flash_Messages::add('fw_extension_settings_saved', __('Extensions settings successfully saved.', 'fw'), 'success');
     $data['redirect'] = fw_current_url();
     do_action('fw_extension_settings_form_saved:' . $extension->get_name(), $options_before_save);
     return $data;
 }
开发者ID:northpen,项目名称:northpen,代码行数:15,代码来源:class--fw-extensions-manager.php


示例19: get

 /**
  * @param null|int|string $item_id
  * @param null|string $option_id
  * @param mixed $default_value
  * @param array $extra_data
  * @return mixed
  */
 public final function get($item_id = null, $option_id = null, $default_value = null, array $extra_data = array())
 {
     if (empty($option_id)) {
         $sub_keys = null;
     } else {
         $option_id = explode('/', $option_id);
         // 'option_id/sub/keys'
         $_option_id = array_shift($option_id);
         // 'option_id'
         $sub_keys = empty($option_id) ? null : implode('/', $option_id);
         // 'sub/keys'
         $option_id = $_option_id;
         unset($_option_id);
     }
     try {
         // Cached because values are merged with extracted default values
         $values = FW_Cache::get($cache_key_values = $this->get_cache_key('values', $item_id, $extra_data));
     } catch (FW_Cache_Not_Found_Exception $e) {
         FW_Cache::set($cache_key_values, $values = is_array($values = $this->get_values($item_id, $extra_data)) ? $values : array());
     }
     /**
      * If db value is not found and default value is provided
      * return default value before the options file is loaded
      */
     if (!is_null($default_value)) {
         if (empty($option_id)) {
             if (empty($values) && is_array($default_value)) {
                 return $default_value;
             }
         } else {
             if (is_null($sub_keys)) {
                 if (!isset($values[$option_id])) {
                     return $default_value;
                 }
             } else {
                 if (is_null(fw_akg($sub_keys, $values[$option_id]))) {
                     return $default_value;
                 }
             }
         }
     }
     try {
         $options = FW_Cache::get($cache_key = $this->get_cache_key('options', $item_id, $extra_data));
     } catch (FW_Cache_Not_Found_Exception $e) {
         FW_Cache::set($cache_key, array());
         // prevent recursion
         FW_Cache::set($cache_key, $options = fw_extract_only_options($this->get_options($item_id, $extra_data)));
     }
     if ($options) {
         try {
             FW_Cache::get($cache_key_values_processed = $this->get_cache_key('values:processed', $item_id, $extra_data));
         } catch (FW_Cache_Not_Found_Exception $e) {
             /**
              * Set cache value before processing options
              * Fixes https://github.com/ThemeFuse/Unyson/issues/2034#issuecomment-248571149
              */
             FW_Cache::set($cache_key_values_processed, true);
             // Complete missing db values with default values from options array
             $values = array_merge(fw_get_options_values_from_input($options, array()), $values);
             foreach ($options as $id => $option) {
                 $values[$id] = fw()->backend->option_type($option['type'])->storage_load($id, $option, isset($values[$id]) ? $values[$id] : null, $this->get_fw_storage_params($item_id, $extra_data));
             }
             FW_Cache::set($cache_key_values, $values);
         }
     }
     if (empty($option_id)) {
         return empty($values) && is_array($default_value) ? $default_value : $values;
     } else {
         if (is_null($sub_keys)) {
             return isset($values[$option_id]) ? $values[$option_id] : $default_value;
         } else {
             return fw_akg($sub_keys, $values[$option_id], $default_value);
         }
     }
 }
开发者ID:puriwp,项目名称:Theme-Framework,代码行数:82,代码来源:class-fw-db-options-model.php


示例20: _get_value_from_input

 /**
  * Extract correct value for $option['value'] from input array
  * If input value is empty, will be returned $option['value']
  *
  * @param array $option
  * @param array|string|null $input_value
  *
  * @return string|array|int|bool Correct value
  * @internal
  */
 protected function _get_value_from_input($option, $input_value)
 {
     if (empty($input_value)) {
         if (empty($option['popup-options'])) {
             return array();
         }
         $popup_options = array();
         foreach (fw_extract_only_options($option['popup-options']) as $popup_option_id => $popup_option) {
             if (isset($option['value'][$popup_option_id])) {
                 $popup_option['value'] = $option['value'][$popup_option_id];
             }
             $popup_options[$popup_option_id] = $popup_option;
         }
         $values = fw_get_options_values_from_input($popup_options, array());
     } else {
         if (is_array($input_value)) {
             /**
              * Don't decode if we have already an array
              */
             $values = $input_value;
         } else {
             $values = json_decode($input_value, true);
         }
     }
     return $values;
 }
开发者ID:cristeamdev,项目名称:Unyson,代码行数:36,代码来源:class-fw-option-type-popup.php



注:本文中的fw_get_options_values_from_input函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP fw_get_template_customizations_directory_uri函数代码示例发布时间:2022-05-15
下一篇:
PHP fw_get_framework_directory_uri函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap