So yes, the problem is not with the saving, it’s how you load the saved data back… See the documentation for get_post_meta: if you dont’ provide a meta data key, the function returns all meta data for that post – which has to be returned as an array. Try this instead:
$littlereds_storedMeta = get_post_meta($post->ID, 'catagory', true);
Note the last parameter “true” which will force the function to return a single value instead of, again, an array.
Hope this helps!
Related Posts:
- Check for update vs new post on save_post action
- How to avoid infinite loop in save_post callback
- $update is always true in save_post
- Action hook ‘save_post’ triggered when deleting posts
- get post meta before it is updated (during SAVE_POST)
- save_post action firing before I publish / save the post
- save_post action only when creating a new post
- Check if value has changed on save_post
- Minimum Word Count Before A Post Can Be Made Pending Review
- update_post_meta() not working in save_post
- How do I save each option in a multiple select menu as it’s own meta_key + meta_value pair?
- Update post on save
- Post meta checkbox becomes unchecked occasionally
- Return code from save_post action?
- update_post_meta not working in save_post
- save_post only saves meta data on second save
- Get Post ID with insert/edit link
- How to manage saving custom field from Quick edit and Post Save using save_post action hook without colliding each other?
- Why save_post_$(custom_post_type) is fired even if I am not already saving a post?
- Set the value of custom field when post is published or updated
- pass error to admin_notices on “quick edit”/save_post action
- save_post requiere at least one uploaded file to be published
- Get $_POST & $_REQUEST values before adding/updating post
- How can I create a new user account while creating a new post, and then set that new user as the author of that new post?
- Validate post checking if child term is assigned
- Clear cache on post of one type when something happens to post of other type
- Why not fire the save_post event?
- Compare custom taxonomies of updated post (or new post) [Updated with progress]
- WordPress 4.9.8 doesn’t save if content has style=”
- Reset all transients on post or page save
- Using PODS data with save_post
- Cant’t delete my custom posts
- where does this $post_id come from?
- Update current WP post every 3 minutes [closed]
- Changing new post to “pending” on publish – but “Publish failed” – why?
- update_post_meta not working in foreach
- Save post in another table
- Strange bug on post/page save
- draft_to_pending action doesn’t seem to fire
- What action to use for when a post is saved / published, with a caveat
- Custom wp_editor doesn’t update post_content
- Save custom value to main content of post
- Check for page template on save_post hook
- Access NEW/UPDATED post values in save_post() callback function
- save button grayed out randomly
- Post editor doesn’t save embed media [closed]
- How to get a post meta value and pass that to update_option when a post is created or updated?
- Save current post using custom save button
- Connection Reset on post/page save
- Meta data not saved on save_post
- Insert/Update DB table when making new post or update older one
- Prevent Page/Post From Being Created based on Pages/Posts per User per Time Unit
- How to debug | Some times the “Save Draft” button seems to spin but does not actually save
- My custom title gets duplicated at every save or post update
- Use save_post to generate file on wordpress
- Detect, if post is saved manually or programmatically in save_post-hook
- update_post_meta and update_field ony working when saving the post
- trigger save_post event programmatically
- Disable the post save process completely
- Saving (Updating) Post / Page Edits With AJAX
- A Post is saved twice or more during add_action(save_post)
- How to store the value of a custom field dropdown select for post referencing?
- prevent post submission
- Remove image from post_content on save_post
- Why does publish_{custom-post-type} fire on update?
- Exclude trash from save_post
- Check if the value of a field has changed on save_post
- Placement of Code in Plugin for hooking `save_post`
- Execute function after a post has been published
- Update post meta value as date difference between two fields
- Get Meta Key Value While Saving Post
- Use the backbone.js client to save custom post type meta
- wp_schedule_single_event issue with save_post hook in gutenberg
- Keep a post copy when this one is updated – issue
- Meta box html is not updating after saving
- How to change image atributes right before an image to be saved?
- Add category only if post has custom taxonomy category
- Updating post data on save (save_post vs wp_insert_post_data)
- Events: Check for other event with same start date and category [closed]
- Stop saving process when metabox is invalid [duplicate]
- Save values from a pre_post_update
- What’s the proper way to sanitize checkbox value sent to the database
- Bug: Post needs to be updated twice when adding action for save_post hook
- update_post_meta not work [closed]
- What is the proper way to add a required field to a post type? [duplicate]
- duplicate entries in database while using save_post or wp_insert_post
- Update Post Taxonomy Automatically Based On Date
- Catch and display error on save_post action
- Perform function on publish AND save (not just save)
- How to create a user ability to save pages with full url?
- Issue migrating a checkbox-type meta field to the block editor
- How to check for duplicate record before saving a Custom Post Type
- Save_post acf data not updating category of post type
- On save_post need to wp_insert_post and save partent post id to child post and child post id to parent post
- How to save post_status using action save_post?
- Custom metabox does not store data
- Generate slug and meta data if meta field is empty
- Problem with ‘save_post’ hook not running
- Out of Memory – Line 791 of WP-DB.php (mysql_real_escape_string)
- Can this react script be optimized? How to make it faster