本文整理匯總了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);
}