本文整理汇总了PHP中cmb_Meta_Box::get_option方法的典型用法代码示例。如果您正苦于以下问题:PHP cmb_Meta_Box::get_option方法的具体用法?PHP cmb_Meta_Box::get_option怎么用?PHP cmb_Meta_Box::get_option使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cmb_Meta_Box
的用法示例。
在下文中一共展示了cmb_Meta_Box::get_option方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hijack_oembed_cache_get
/**
* Hijacks retrieving of cached oEmbed.
* Returns cached data from relevant object metadata (vs postmeta)
*
* @since 0.9.5
* @param boolean $check Whether to retrieve postmeta or override
* @param int $object_id Object ID
* @param string $meta_key Object metakey
* @return mixed Object's oEmbed cached data
*/
public static function hijack_oembed_cache_get($check, $object_id, $meta_key)
{
if (!self::$hijack || self::$object_id != $object_id && 1987645321 !== $object_id) {
return $check;
}
// get cached data
$data = 'options-page' === self::$object_type ? cmb_Meta_Box::get_option(self::$object_id, self::$embed_args['cache_key']) : get_metadata(self::$object_type, self::$object_id, $meta_key, true);
return $data;
}
示例2: get_data
/**
* Retrieves metadata/option data
* @since 1.0.1
* @param string $field_id Meta key/Option array key
* @return mixed Meta/Option value
*/
public function get_data($field_id = '', $args = array())
{
if ($field_id) {
$args['field_id'] = $field_id;
} else {
if ($this->group) {
$args['field_id'] = $this->group->id();
}
}
extract($this->data_args($args));
$data = 'options-page' === $type ? cmb_Meta_Box::get_option($id, $field_id) : get_metadata($type, $id, $field_id, $single || $repeat);
if ($this->group && $data) {
$data = isset($data[$this->group->args('count')][$this->args('_id')]) ? $data[$this->group->args('count')][$this->args('_id')] : false;
}
return $data;
}
示例3: cmb_get_option
/**
* A helper function to get an option from a CMB options array
* @since 1.0.1
* @param string $option_key Option key
* @param string $field_id Option array field key
* @return array Options array or specific field
*/
function cmb_get_option($option_key, $field_id = '')
{
return cmb_Meta_Box::get_option($option_key, $field_id);
}