Support » Plugin: Exports and Reports » Custom fields containing arrays

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    In the fields settings, you can specify a display function to run through.

    Try setting it to “my_custom_serialize_display”

    and then add this code to your site:

    function my_custom_serialize_display ( $value, $row, $field, $attributes, &$obj ) {
        $data = maybe_unserialize( $value ) );
    
        if ( is_array( $data ) ) {
            // Do something with $data, and set $value
        }
    
        return $value;
    }

    Actually… I just figured this out…

    TRIM(BOTH '"' FROM SUBSTRING_INDEX(SUBSTRING_INDEX(int_4_postmeta.meta_value, ';', 2), ':', -1))
              AS Notes,
           TRIM(BOTH '"' FROM SUBSTRING_INDEX(SUBSTRING_INDEX(int_4_postmeta.meta_value, ';', 4), ':', -1))
              AS Type,
           TRIM(BOTH '"' FROM SUBSTRING_INDEX(SUBSTRING_INDEX(int_4_postmeta.meta_value, ';', 6), ':', -1))
              AS Date
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom fields containing arrays’ is closed to new replies.