parse_relationship_field() 공개 정적인 메소드

Parse the raw value of the relationship and association fields.
public static parse_relationship_field ( string $raw_value = '', string $type = '' ) : array
$raw_value string Raw relationship value.
$type string Field type.
리턴 array Array of parsed data.
예제 #1
0
 /**
  * Echoes the widget content.
  * Sub-classes can over-ride this method to generate their widget code
  * but it is best to override front_end().
  *
  * @param array $args     Display arguments including 'before_title', 'after_title',
  *                        'before_widget', and 'after_widget'.
  * @param array $instance The settings for the particular instance of the widget.
  */
 public function widget($args, $instance)
 {
     // prepare $instance values for complex fields
     if (!empty($this->complex_field_names)) {
         $instance = self::unwrap_complex_field_values($instance, $this->complex_field_names);
     }
     // prepare $instance values for association fields
     foreach ($instance as &$field_value) {
         $field_value = Helper::parse_relationship_field($field_value);
     }
     // output
     if ($this->print_wrappers) {
         echo $args['before_widget'];
     }
     $this->front_end($args, $instance);
     if ($this->print_wrappers) {
         echo $args['after_widget'];
     }
 }