You need to pass get_user_meta
a third parameter to prevent it from returning an array. That is where the mistake is, not with the add/update functions.
$invoice_meta = get_user_meta( $_GET['id'], 'invoices', true);
You will need to clean up any data already in the database or the existing nested arrays will still cause trouble.
Related Posts:
- How do I update a specific object in an array, in user meta?
- How to save data of an input field to an array
- Updating wordpress user meta data array (unexpected multiple arrays)
- Nice way to print_r arrays
- Why does get_users suddenly return duplicates?
- WordPress: How to use post_class() in an echo
- Building a scalable WordPress favouriting plugin – one serialised meta value array or many meta records
- How do I pass an array as an argument to a WP-CLI command?
- Updating wp_options with an array on save_post results in duplicated entries
- Comma seperated list of ID’s as an array?
- post__in works but also prints the word Array
- Make Selected Mutiselect Items “selected”
- if is_singular array not working as expected
- How to save array of datas in option page by setting api?
- Sort a custom post type array numerically
- How to add day number and initial to my post graph?
- How to validate register settings array
- How to check an array of $curauth fields?
- Multiple User-Meta Values in One User-Meta Key
- How to use IN array properly in WordPress?
- Minimize database queries to user tables?
- WordPress Plugin Dev: Using array for WP options
- Only a part of array is stored in transient – what could be causing this?
- How to get update_post_meta output to include string length
- Return array keys and values
- get_*_meta doesn’t always return an array
- Echoing a variable inside a function
- Stuck with a Custom Field Check box Array
- Compare with WP Meta Query
- How to Translate a string of an array inside a class?
- How to pass conditional array to wp_localize_script
- Modify foreach loop for social sharing links?
- Selecting and outputting results from DB with an array
- Struggling with array and foreach loop
- WordPress i18n in Array throws Error
- How to use json_decode a post_meta value? [duplicate]
- Save meta box values as an array to wp_postmeta
- How to display line breaked meta values in table?
- Organizing and grouping an array by year
- array_filter warning – wp-includes/post.php line 3148
- Can’t access PHP array inside script localization from javascript
- Hide sidebar if post_type is in array
- Saving array keep adding length of array
- Array: What is this value based on?
- How to get a page array and category array going at the same time?
- get_the_terms, whether I should use string or array as the second parameter?
- last_name + first_name orderby with meta_query [solved]
- Obtaining array item from WordPress revisions output
- If Array Values Match Another Array’s Values, Then
- Print specific values stored in a post meta array
- Comapare get_user_meta value
- How can get all users by current user meta?
- Do not replicate items if they exists in a foreach loop
- How to put an array in wp user query
- Exclude specific user_id from args in get_comments
- Get the values from an array string to work with post__in
- return paginate_comments_links() as array
- Inserting a random number into an array [closed]
- Get array value
- Ways of dealing with nested arrays within option
- How to randomise my menu items?
- How to display user_meta array as a table?
- Counting instances of words in the results of a post query
- how to get users with usermeta include array of an array
- Taxonomy terms not properly displaying as array
- WordPress, result array of ‘post_name’
- Why are array_slice() and array_chunk() not working?
- Retrieve array items without page ID
- Store custom field’s multiple values in one user meta key
- Strange Behavior with update_option
- wp_update_post to set post IDs to drafts not working
- get_users when from meta key that has serialized values
- How i can extract data
- How to set an array of current usernames
- Show Tags of Custom Post Type outside of Loop
- wp_set_object_terms not accepting variable array
- How do I pull post from standard post format?
- WPML admin texts with serialized objects
- Merge arrays and order set and subset as one
- Need help getting a certain value out of a multi dimensional array
- The writing ( with foreach) of the keys of an array of objects to a new array produces fatal error
- Create dropdown menu of all tags used in category
- How can I get a list of custom post IDs into a variable I can use for another function?
- Use $wp_customize->add_control to create a selectable “Designed/Powered By” choices select w/ link in footer?
- using array in wordpress database query
- update_post_meta array issues
- Matching usermeta at registration to categories of content
- How do I retrieve a value from a multi – dimensional array using get_post_meta? [duplicate]
- Accessing value from associative array
- Accessing array elements (get_pages)
- Printing out JSON array returned [closed]
- Fatal error in my WP
- Marketpress php warning on server, no problem on localhost [closed]
- SQL query add only posts with custom field to array
- Combine two foreach Arrays into one table row
- How to match data in multidimensional array of post_meta_data?
- Insert data into custom table from fetching $_POST values
- Populate Array with values from another arrray [closed]
- how to separate array with commas? [closed]
- Multipe array in meta_input