';
return $output;
}
/**
* Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
*
* @param array $field Field parameters.
* @param array $value The value.
* @param array $args Additional arguments. Rarely used. See specific fields for details.
* @param int|null $post_id Post ID. null for current post. Optional.
*
* @return string
*/
public static function format_single_value( $field, $value, $args, $post_id ) {
$output = '
';
foreach ( $value as $subvalue ) {
$output .= "
$subvalue
";
}
$output .= '
';
return $output;
}
/**
* Save meta value.
*
* @param mixed $new The submitted meta value.
* @param mixed $old The existing meta value.
* @param int $post_id The post ID.
* @param array $field The field parameters.
*/
public static function save( $new, $old, $post_id, $field ) {
if ( empty( $field['id'] ) || ! $field['save_field'] ) {
return;
}
$storage = $field['storage'];
$storage->delete( $post_id, $field['id'] );
parent::save( $new, array(), $post_id, $field );
}
}