Title: Post type user error
Last modified: May 21, 2021

---

# Post type user error

 *  [adrianspk](https://wordpress.org/support/users/adrianspk/)
 * (@adrianspk)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/post-type-user-error/)
 * Hello!
    When I select the fied to append to an user field type it shows “array”,
   can you help?
 * It seemns that the user field type returns an array that looks like this:
 *     ```
       [ID] => 6
           [user_firstname] => John
           [user_lastname] => Doe
           [nickname] => johndoe
           [user_nicename] => johndoe
           [display_name] => John Doe
           [user_email] => john.doe@site.com
           [user_url] => 
           [user_registered] => 2016-07-03 12:23:56
           [user_description] => 
           [user_avatar] =>
       ```
   
 * Thank you!

Viewing 1 replies (of 1 total)

 *  Plugin Author [David Baumwald](https://wordpress.org/support/users/davidbaumwald/)
 * (@davidbaumwald)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/post-type-user-error/#post-14476778)
 * Hello [@adrianspk](https://wordpress.org/support/users/adrianspk/)! What I think
   would be best is to directly filter the field output after the generic output
   is compiled. The “User” field type has three output value types: array, object,
   or ID. Looks like you’re using the default of `array`. Using `apply_filters( '
   de/acfpoftao/format_post_title', $title, $post, $field, $post_id )` will work
   like this…
 *     ```
       function de_filter_post_object_add_on_output( $title, $post ) {
       		$append_field = get_option( 'de_acfpoftao_append_field' );
       		$user         = get_field( $append_field, absint( $post->ID ) );	
   
       		if ( ! $user || empty( $append_field_value ) ) {
       			return $title;
       		}
   
       		$append_field_value = $user['display_name'];
   
       		$format = apply_filters( 'de/acfpoftao/append_field_data_format', get_option( 'de_acfpoftao_append_field_format' ) );
   
       		switch ( true ) {
       			case preg_match( "/^separator::(.*)/", $format, $matches ):
       				$title .= ' &' . $matches[1] . '; ' . $append_field_value;
       				break;
       			case preg_match( "/^wrap::(.*)/", $format, $matches ):
       				$title .= ' &l' . $matches[1] . ';' . $append_field_value . '&r' . $matches[1] . ';';
       				break;
       			default:
       				$title .= ' (' . $append_field_value .  ')';
       				break;
       		}
   
       		return $title;
       	}
   
       	add_filter( 'de/acfpoftao/format_post_title', 'de_filter_post_object_add_on_output', 10, 2 );
       ```
   
 * Note: I’ve not tested this code, but in theory it should work.
    -  This reply was modified 4 years, 11 months ago by [David Baumwald](https://wordpress.org/support/users/davidbaumwald/).
    -  This reply was modified 4 years, 11 months ago by [David Baumwald](https://wordpress.org/support/users/davidbaumwald/).

Viewing 1 replies (of 1 total)

The topic ‘Post type user error’ is closed to new replies.

 * ![](https://ps.w.org/acf-post-object-field-type-add-on/assets/icon-256x256.png?
   rev=1559963)
 * [ACF Post Object Field Type Add-on](https://wordpress.org/plugins/acf-post-object-field-type-add-on/)
 * [Support Threads](https://wordpress.org/support/plugin/acf-post-object-field-type-add-on/)
 * [Active Topics](https://wordpress.org/support/plugin/acf-post-object-field-type-add-on/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/acf-post-object-field-type-add-on/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/acf-post-object-field-type-add-on/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [David Baumwald](https://wordpress.org/support/users/davidbaumwald/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/post-type-user-error/#post-14476778)
 * Status: not resolved