/** * 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); }
/** * 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; }