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

PHP fw_akg函数代码示例

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

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



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

示例1: get

 /**
  * @param int $post_id
  * @param string $multi_key 'abc' or 'ab/c/def'
  * @param bool|null $get_original_value Original value from db, no changes and translations
  * @return mixed|null
  */
 public static function get($post_id, $multi_key, $get_original_value = null)
 {
     if ($get_original_value === null) {
         $get_original_value = is_admin();
     }
     if (empty($multi_key)) {
         trigger_error('Key not specified', E_USER_WARNING);
         return null;
     }
     $multi_key = explode('/', $multi_key);
     $key = array_shift($multi_key);
     $multi_key = implode('/', $multi_key);
     $cache_key = self::$cache_key . '/' . $post_id . '/' . $key;
     try {
         $values = FW_Cache::get($cache_key);
     } catch (FW_Cache_Not_Found_Exception $e) {
         $values = array();
         $values['original'] = get_post_meta($post_id, $key, true);
         $values['prepared'] = fw_prepare_option_value($values['original']);
         FW_Cache::set($cache_key, $values);
     }
     if (empty($multi_key)) {
         return $values[$get_original_value ? 'original' : 'prepared'];
     } else {
         return fw_akg($multi_key, $values[$get_original_value ? 'original' : 'prepared']);
     }
 }
开发者ID:AdsonCicilioti,项目名称:Unyson,代码行数:33,代码来源:class-fw-wp-post-meta.php


示例2: fw_akg

/**
 * Recursively find a key's value in array
 *
 * @param string $keys 'a/b/c'
 * @param array|object $array_or_object
 * @param null|mixed $default_value
 * @param string $keys_delimiter
 * @return null|mixed
 */
function fw_akg($keys, &$array_or_object, $default_value = null, $keys_delimiter = '/')
{
    if (!is_array($keys)) {
        $keys = explode($keys_delimiter, (string) $keys);
    }
    $key_or_property = array_shift($keys);
    if ($key_or_property === null) {
        return $default_value;
    }
    $is_object = is_object($array_or_object);
    if ($is_object) {
        if (!property_exists($array_or_object, $key_or_property)) {
            return $default_value;
        }
    } else {
        if (!is_array($array_or_object) || !array_key_exists($key_or_property, $array_or_object)) {
            return $default_value;
        }
    }
    if (isset($keys[0])) {
        // not used count() for performance reasons
        if ($is_object) {
            return fw_akg($keys, $array_or_object->{$key_or_property}, $default_value);
        } else {
            return fw_akg($keys, $array_or_object[$key_or_property], $default_value);
        }
    } else {
        if ($is_object) {
            return $array_or_object->{$key_or_property};
        } else {
            return $array_or_object[$key_or_property];
        }
    }
}
开发者ID:joelgarciajr84,项目名称:Unyson,代码行数:43,代码来源:general.php


示例3: after

 public function after($data = array())
 {
     $update_actions = array('extensions_page' => fw_html_tag('a', array('href' => fw_akg('extensions_page_link', $data, '#'), 'title' => __('Go to extensions page', 'fw'), 'target' => '_parent'), __('Return to Extensions page', 'fw')));
     $this->feedback(implode(' | ', (array) $update_actions));
     if ($this->result) {
         // used for popup ajax form submit result
         $this->feedback('<span success></span>');
     }
 }
开发者ID:puriwp,项目名称:Theme-Framework,代码行数:9,代码来源:class--fw-extensions-delete-upgrader-skin.php


示例4: get

 /**
  * @param string $option_name
  * @param string|null $specific_multi_key 'ab/c/def'
  * @param null|mixed $default_value If no option found in the database, this value will be returned
  * @param bool|null $get_original_value REMOVED https://github.com/ThemeFuse/Unyson/issues/1676
  * @return mixed|null
  */
 public static function get($option_name, $specific_multi_key = null, $default_value = null, $get_original_value = null)
 {
     if (!is_null($get_original_value)) {
         _doing_it_wrong(__FUNCTION__, '$get_original_value parameter was removed', 'Unyson 2.5.8');
     }
     $value = get_option($option_name, null);
     if (empty($specific_multi_key) && $specific_multi_key !== '0') {
         return is_null($value) ? $default_value : $value;
     } else {
         return fw_akg($specific_multi_key, $value, $default_value);
     }
 }
开发者ID:puriwp,项目名称:Theme-Framework,代码行数:19,代码来源:class-fw-wp-option.php


示例5: sanitize

 public function sanitize($value)
 {
     $value = json_decode($value, true);
     if (is_null($value) || !is_array($value)) {
         return null;
     }
     $POST = array();
     foreach ($value as $var) {
         fw_aks(fw_html_attr_name_to_array_multi_key($var['name'], true), $var['value'], $POST);
     }
     $value = fw()->backend->option_type($this->fw_option['type'])->get_value_from_input($this->fw_option, fw_akg(fw_html_attr_name_to_array_multi_key($this->id), $POST));
     return $value;
 }
开发者ID:puriwp,项目名称:Theme-Framework,代码行数:13,代码来源:class--fw-customizer-setting-option.php


示例6: _load

 /**
  * {@inheritdoc}
  */
 protected function _load($id, array $option, $value, array $params)
 {
     if ($wp_option = $this->get_wp_option($option, $params)) {
         if (isset($option['fw-storage']['key'])) {
             $wp_option_value = get_option($wp_option, array());
             return fw_akg($option['fw-storage']['key'], $wp_option_value, $value);
         } else {
             return get_option($wp_option, $value);
         }
     } else {
         return $value;
     }
 }
开发者ID:cristeamdev,项目名称:Unyson,代码行数:16,代码来源:class-fw-option-storage-type-wp-option.php


示例7: 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


示例8: _render

 protected function _render($atts, $content = null, $tag = '')
 {
     if (!isset($atts['data_provider']['population_method'])) {
         trigger_error(__('No events provider specified for calendar shortcode', 'fw'));
         return '<b>Calendar Placeholder</b>';
     }
     $this->load_data();
     $provider = $atts['data_provider']['population_method'];
     if (!isset($this->data[$provider])) {
         trigger_error(sprintf(__('Unknown events provider "%s" specified for calendar shortcode', 'fw'), $provider));
         return '<b>Calendar Placeholder</b>';
     }
     $ajax_params = apply_filters('fw_shortcode_calendar_ajax_params', array(), $provider, fw_akg('data_provider/' . $provider, $atts));
     if (is_array($ajax_params)) {
         $ajax_params = array_merge($ajax_params, array('data_provider' => $provider));
     } else {
         $ajax_params = array('data_provider' => $provider);
     }
     $wrapper_atts = array('data-extends-ajax-params' => json_encode($ajax_params), 'data-ajax-url' => admin_url('admin-ajax.php'), 'data-template' => $atts['template'], 'data-template-path' => $this->get_declared_URI('/views/'), 'data-first-day' => $atts['first_week_day']);
     if ($provider === 'custom') {
         $rows = fw_akg('data_provider/custom/custom_events', $atts, array());
         $event_sources = array();
         if (empty($rows) === false) {
             $key = 0;
             foreach ($rows as $row) {
                 if (empty($row['calendar_date_range']['from']) || empty($row['calendar_date_range']['to'])) {
                     continue;
                 }
                 $event_sources[$key]['id'] = $key;
                 $start = new DateTime($row['calendar_date_range']['from'], new DateTimeZone('GMT'));
                 $end = new DateTime($row['calendar_date_range']['to'], new DateTimeZone('GMT'));
                 //set end of all_day event time 23:59:59
                 if ($start == $end and $end->format('H:i') === '00:00') {
                     $end->modify('+23 hour');
                     $end->modify('+59 minutes');
                     $end->modify('+59 second');
                 }
                 $event_sources[$key]['start'] = $start->format('U');
                 $event_sources[$key]['end'] = $end->format('U');
                 $event_sources[$key]['title'] = htmlspecialchars_decode($row['title']);
                 $event_sources[$key]['url'] = $row['url'];
                 $key++;
             }
         }
         $wrapper_atts['data-event-source'] = json_encode($event_sources);
     }
     $this->enqueue_static();
     return fw_render_view($this->locate_path('/views/view.php'), compact('atts', 'content', 'tag', 'wrapper_atts'));
 }
开发者ID:northpen,项目名称:northpen,代码行数:49,代码来源:class-fw-shortcode-calendar.php


示例9: fw_ext_builder_get_item_width

/**
 * Get builder item width data
 *
 * Default widths are specified in the config, but some builder types can have custom widths
 *
 * Usage example:
 * <div class="<?php echo esc_attr(fw_ext_builder_get_item_width('builder-type', $item['width'] .'/frontend_class')) ?>" >
 *
 * @param string $builder_type Builder option type (some builders can have different item widths)
 * @param null|string $width_id Specify width id (accepts multikey) or leave empty to get all widths
 * @param null|mixed $default_value Return this value if specified key does not exist
 * @return array
 */
function fw_ext_builder_get_item_width($builder_type, $width_id = null, $default_value = null)
{
    try {
        $cache_key = fw()->extensions->get('builder')->get_cache_key('item_widths/' . $builder_type);
        $widths = FW_Cache::get($cache_key);
    } catch (FW_Cache_Not_Found_Exception $e) {
        $widths = apply_filters('fw_builder_item_widths:' . $builder_type, fw()->extensions->get('builder')->get_config('default_item_widths'));
        FW_Cache::set($cache_key, $widths);
    }
    if (is_null($width_id)) {
        return $widths;
    } else {
        return fw_akg($width_id, $widths, $default_value);
    }
}
开发者ID:setcomunicacao,项目名称:setdigital,代码行数:28,代码来源:helpers.php


示例10: get_config

 public function get_config($key = null)
 {
     if (!$this->config) {
         $config_path = $this->path . '/config.php';
         if (file_exists($config_path)) {
             $vars = fw_get_variables_from_file($config_path, array('cfg' => null));
             $this->config = $vars['cfg'];
         }
     }
     if (!is_array($this->config)) {
         return null;
     } else {
         return $key === null ? $this->config : fw_akg($key, $this->config);
     }
 }
开发者ID:AdsonCicilioti,项目名称:Unyson,代码行数:15,代码来源:class-fw-shortcode.php


示例11: get

 /**
  * @param string $option_name
  * @param string|null $specific_multi_key 'ab/c/def'
  * @param null|mixed $default_value If no option found in the database, this value will be returned
  * @param bool|null $get_original_value Original value from db, no changes and translations
  * @return mixed|null
  */
 public static function get($option_name, $specific_multi_key = null, $default_value = null, $get_original_value = null)
 {
     if ($get_original_value === null) {
         $get_original_value = is_admin();
     }
     $cache_key = self::$cache_key . '/' . $option_name;
     try {
         $values = FW_Cache::get($cache_key);
     } catch (FW_Cache_Not_Found_Exception $e) {
         $values = array();
         $values['original'] = get_option($option_name, null);
         $values['prepared'] = fw_prepare_option_value($values['original']);
         FW_Cache::set($cache_key, $values);
     }
     return fw_akg(($get_original_value ? 'original' : 'prepared') . (empty($specific_multi_key) ? '' : '/' . $specific_multi_key), $values, $default_value);
 }
开发者ID:cristeamdev,项目名称:Unyson,代码行数:23,代码来源:class-fw-wp-option.php


示例12: _load

 /**
  * {@inheritdoc}
  */
 protected function _load($id, array $option, $value, array $params)
 {
     if ($post_id = $this->get_post_id($option, $params)) {
         $meta_id = $this->get_meta_id($id, $option, $params);
         $meta_value = get_post_meta($post_id, $meta_id, true);
         if ($meta_value === '' && is_array($value)) {
             return $value;
         }
         if (isset($option['fw-storage']['key'])) {
             return fw_akg($option['fw-storage']['key'], $meta_value, $value);
         } else {
             return $meta_value;
         }
     } else {
         return $value;
     }
 }
开发者ID:puriwp,项目名称:Theme-Framework,代码行数:20,代码来源:class-fw-option-storage-type-post-meta.php


示例13: _render

 /**
  * @internal
  * {@inheritdoc}
  */
 protected function _render($id, $option, $data)
 {
     $options_array = $this->prepare_option($id, $option);
     unset($option['attr']['name'], $option['attr']['value']);
     if ($option['show_borders']) {
         $option['attr']['class'] .= ' fw-option-type-multi-picker-with-borders';
     } else {
         $option['attr']['class'] .= ' fw-option-type-multi-picker-without-borders';
     }
     reset($option['picker']);
     $picker_key = key($option['picker']);
     $picker_type = $option['picker'][$picker_key]['type'];
     $picker = $option['picker'][$picker_key];
     if (!is_string($picker_value = fw()->backend->option_type($picker_type)->get_value_from_input($picker, isset($data['value'][$picker_key]) ? $data['value'][$picker_key] : null))) {
         /**
          * Extract the string value that is used as array key
          */
         switch ($picker_type) {
             case 'icon-v2':
                 $picker_value = fw_akg('type', $picker_value, 'icon-font');
                 break;
             default:
                 if (!is_string($picker_value = apply_filters('fw:option-type:multi-picker:string-value:' . $picker_type, $picker_value))) {
                     trigger_error('[multi-picker] Cannot detect string value for picker type ' . $picker_type, E_USER_WARNING);
                     $picker_value = '?';
                 }
         }
     }
     $skip_first = true;
     foreach ($options_array as $group_id => &$group) {
         if ($skip_first) {
             $skip_first = false;
             continue;
             // first is picker
         }
         if ($group_id === $id . '-' . $picker_value) {
             continue;
             // skip selected choice options
         }
         $options_array[$group_id]['attr']['data-options-template'] = fw()->backend->render_options($options_array[$group_id]['options'], $data['value'], array('id_prefix' => $data['id_prefix'] . $id . '-', 'name_prefix' => $data['name_prefix'] . '[' . $id . ']'));
         $options_array[$group_id]['options'] = array();
     }
     return '<div ' . fw_attr_to_html($option['attr']) . '>' . fw()->backend->render_options($options_array, $data['value'], array('id_prefix' => $data['id_prefix'] . $id . '-', 'name_prefix' => $data['name_prefix'] . '[' . $id . ']')) . '</div>';
 }
开发者ID:puriwp,项目名称:Theme-Framework,代码行数:48,代码来源:class-fw-option-type-multi-picker.php


示例14: _render

 protected function _render($id, $option, $data)
 {
     $wrapper_attr = $option['attr'];
     $moment_format = $option['datetime-picker']['moment-format'];
     $wrapper_attr['data-min-date'] = fw_akg('datetime-picker/minDate', $option, false);
     $wrapper_attr['data-max-date'] = fw_akg('datetime-picker/maxDate', $option, false);
     $wrapper_attr['data-extra-formats'] = isset($option['datetime-picker']['extra-formats']) ? json_encode($option['datetime-picker']['extra-formats']) : '';
     $wrapper_attr['data-datetime-attr'] = json_encode($option['datetime-picker']);
     unset($option['datetime-picker']['moment-format'], $option['datetime-picker']['extra-formats'], $option['attr']['class'], $wrapper_attr['name'], $wrapper_attr['id'], $wrapper_attr['value']);
     if (isset($option['datetime-picker']['value'])) {
         unset($option['datetime-picker']['value']);
     }
     $option['datetime-picker']['scrollInput'] = false;
     $option['datetime-picker']['lang'] = substr(get_locale(), 0, 2);
     $option['attr']['data-moment-format'] = $moment_format;
     echo '<div ' . fw_attr_to_html($wrapper_attr) . ' >';
     echo fw()->backend->option_type('text')->render($id, $option, $data);
     echo '</div>';
 }
开发者ID:HilderH,项目名称:emprendamos,代码行数:19,代码来源:class-fw-option-type-datetime-picker.php


示例15: get

 /**
  * @param string $meta_type
  * @param int $object_id
  * @param string $multi_key 'abc' or 'ab/c/def'
  * @param null|mixed $default_value If no option found in the database, this value will be returned
  * @param bool|null $get_original_value REMOVED https://github.com/ThemeFuse/Unyson/issues/1676
  *
  * @return mixed|null
  */
 public static function get($meta_type, $object_id, $multi_key, $default_value = null, $get_original_value = null)
 {
     if (!is_null($get_original_value)) {
         _doing_it_wrong(__FUNCTION__, '$get_original_value parameter was removed', 'Unyson 2.5.8');
     }
     if (empty($multi_key)) {
         trigger_error('Key not specified', E_USER_WARNING);
         return null;
     }
     $multi_key = explode('/', $multi_key);
     $key = array_shift($multi_key);
     $multi_key = implode('/', $multi_key);
     $value = get_metadata($meta_type, $object_id, $key, true);
     if (empty($multi_key) && $multi_key !== '0') {
         return $value;
     } else {
         return fw_akg($multi_key, $value, $default_value);
     }
 }
开发者ID:puriwp,项目名称:Theme-Framework,代码行数:28,代码来源:class-fw-wp-meta.php


示例16: _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


示例17: collect_extensions_that_requires

 /**
  * @param array $collected The found extensions {'extension_name' => array()}
  * @param array $extensions {'extension_name' => array()}
  * @param bool $check_all Check all extensions or only active extensions
  */
 private function collect_extensions_that_requires(&$collected, $extensions, $check_all = false)
 {
     if (empty($extensions)) {
         return;
     }
     $found_extensions = array();
     foreach ($this->get_installed_extensions() as $extension_name => $extension_data) {
         if (isset($collected[$extension_name])) {
             continue;
         }
         if (!$check_all) {
             if (!fw_ext($extension_name)) {
                 continue;
             }
         }
         if (array_intersect_key($extensions, fw_akg('requirements/extensions', $extension_data['manifest'], array()))) {
             $found_extensions[$extension_name] = $collected[$extension_name] = array();
         }
     }
     $this->collect_extensions_that_requires($collected, $found_extensions, $check_all);
 }
开发者ID:northpen,项目名称:northpen,代码行数:26,代码来源:class--fw-extensions-manager.php


示例18: REQUEST

 public static function REQUEST($multikey = null, $default_value = null)
 {
     return fw_stripslashes_deep_keys($multikey === null ? $_REQUEST : fw_akg($multikey, $_REQUEST, $default_value));
 }
开发者ID:puriwp,项目名称:Theme-Framework,代码行数:4,代码来源:class-fw-request.php


示例19: get_config

 /**
  * Return config key value, or entire config array
  * Config array is merged from child configs
  * @param string|null $key Multi key format accepted: 'a/b/c'
  * @param mixed $default_value
  * @return mixed|null
  */
 public final function get_config($key = null, $default_value = null)
 {
     $cache_key = self::$cache_key . '/config';
     try {
         $config = FW_Cache::get($cache_key);
     } catch (FW_Cache_Not_Found_Exception $e) {
         $config = array('settings_form_ajax_submit' => true, 'settings_form_side_tabs' => false);
         if (file_exists(fw_get_template_customizations_directory('/theme/config.php'))) {
             $variables = fw_get_variables_from_file(fw_get_template_customizations_directory('/theme/config.php'), array('cfg' => null));
             if (!empty($variables['cfg'])) {
                 $config = array_merge($config, $variables['cfg']);
                 unset($variables);
             }
         }
         if (is_child_theme() && file_exists(fw_get_stylesheet_customizations_directory('/theme/config.php'))) {
             $variables = fw_get_variables_from_file(fw_get_stylesheet_customizations_directory('/theme/config.php'), array('cfg' => null));
             if (!empty($variables['cfg'])) {
                 $config = array_merge($config, $variables['cfg']);
                 unset($variables);
             }
         }
         unset($path);
         FW_Cache::set($cache_key, $config);
     }
     return $key === null ? $config : fw_akg($key, $config, $default_value);
 }
开发者ID:rawcreative,项目名称:Unyson,代码行数:33,代码来源:theme.php


示例20: get_config

 /**
  * Return config key value, or entire config array
  * Config array is merged from child configs
  * @param string|null $key Multi key format accepted: 'a/b/c'
  * @return mixed|null
  */
 public final function get_config($key = null)
 {
     $cache_key = self::$cache_key . '/config';
     try {
         $config = FW_Cache::get($cache_key);
     } catch (FW_Cache_Not_Found_Exception $e) {
         $config = array();
         if (file_exists(FW_PT_CUSTOM_DIR . '/theme/config.php')) {
             $variables = fw_get_variables_from_file(FW_PT_CUSTOM_DIR . '/theme/config.php', array('cfg' => null));
             if (!empty($variables['cfg'])) {
                 $config = array_merge($config, $variables['cfg']);
                 unset($variables);
             }
         }
         if (FW_CT && file_exists(FW_CT_CUSTOM_DIR . '/theme/config.php')) {
             $variables = fw_get_variables_from_file(FW_CT_CUSTOM_DIR . '/theme/config.php', array('cfg' => null));
             if (!empty($variables['cfg'])) {
                 $config = array_merge($config, $variables['cfg']);
                 unset($variables);
             }
         }
         unset($path);
         FW_Cache::set($cache_key, $config);
     }
     return $key === null ? $config : fw_akg($key, $config);
 }
开发者ID:AdsonCicilioti,项目名称:Unyson,代码行数:32,代码来源:theme.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP fw_aks函数代码示例发布时间:2022-05-15
下一篇:
PHP fw函数代码示例发布时间: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