本文整理汇总了PHP中RWMB_Select_Field::meta方法的典型用法代码示例。如果您正苦于以下问题:PHP RWMB_Select_Field::meta方法的具体用法?PHP RWMB_Select_Field::meta怎么用?PHP RWMB_Select_Field::meta使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RWMB_Select_Field
的用法示例。
在下文中一共展示了RWMB_Select_Field::meta方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: meta
/**
* Get meta value
* If field is cloneable, value is saved as a single entry in DB
* Otherwise value is saved as multiple entries (for backward compatibility)
*
* @see "save" method for better understanding
*
* @param $post_id
* @param $saved
* @param $field
*
* @return array
*/
static function meta($post_id, $saved, $field)
{
if (isset($field['parent']) && $field['parent']) {
$post = get_post($post_id);
return $post->post_parent;
}
return RWMB_Select_Field::meta($post_id, $saved, $field);
}
示例2: meta
/**
* Get meta value
* If field is cloneable, value is saved as a single entry in DB
* Otherwise value is saved as multiple entries (for backward compatibility)
*
* @see "save" method for better understanding
*
* @param $meta
* @param $post_id
* @param $saved
* @param $field
*
* @return array
*/
static function meta($meta, $post_id, $saved, $field)
{
$meta = RWMB_Select_Field::meta($meta, $post_id, $saved, $field);
return is_array($meta) ? current($meta) : $meta;
}