You can insert an associative array into the post_meta_field.
Here is a quick little function to grab the data afterward (did not test):
function grab_task_name_array($post_id) {
$new_array = array();
$array = get_post_meta($post_id,'_task-name'); //do not put true as third parameter (this would return string and not array)
foreach($array[0] as $key => $value)
$new_array[$key] = $value;
return $new_array;
}
If you wanted to store a multidimensional array, some more checks would be needed.
Related Posts:
- Get Posts Under Custom Taxonomy
- Displaying the category name of a custom post type
- Show WordPress Custom Taxonomy Items Based On a Selected Item From Another Custom Taxonomy
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- How are terms connected with posts in database?
- Importing data from spreadsheet into wordpress DB, along with custom taxonomies and their terms
- get_terms parent for current product only
- deleting terms programmatically
- How do I get the slug of a custom taxonomy category of a post?
- get_the_terms() to show all custom taxonomies
- How can I add a meta-box to the posts editor containing all items of a custom taxonomy as checkbox?
- Avoid duplicate post from same Taxonomy
- Get posts by name and taxonomy term
- Set terms in a custom post
- Get posts of ONE taxonomy term of custom post type
- Choose whether to automatically add a taxonomy with the same name as the post
- Setting posts_per_page for taxonomy term template
- Force the “Choose from the most used tags” meta box section to always be expanded
- Posts list in custom taxonomy
- Get Posts Under Custom Taxonomy
- How to display posts via custom taxonomy terms using checkboxes?
- Saving custom fields to a custom taxonomy
- Copy taxonomy terms from one post to another programmatically
- Loop parent terms {display posts} AND loop child terms {display posts}
- Check if current user has a post and that post has any term/s from a specific custom taxonomy outside the loop
- How to associate a custom taxonomy to a post multiple times
- Customizing URL slugs of Custom Post Type and Taxonomy make posts/pages 404
- Filter By Term Not Working – Custom Post Type
- How to get post count including nested categories
- Custom Taxonomy From Database
- Displaying Results From Custom Taxonomy Query
- Multiple loops on a Search result page?
- How to get all the terms of a post
- How can I retrieve multiple get_post_meta values efficiently?
- How to limit the number of terms (terms acts like categories)
- Export WordPress Posts and Meta Information in CSV format
- How can I select a primary category?
- Return only the custom sub-term for custom post type, do not echo term-parent
- Formating the_terms() function output
- Change post format using custom field
- Checking if a Page has an Associated Term?
- What are terms and taxonomy, how they related to post and how these three are stored in database?
- Get terms ordered by post date
- Show the author’s count of total amount of posts assign to a custom taxonomy term
- What Is meta_id In wp_postmeta?
- How to generate numbers indistinguishable for the IDs of the posts
- Get Current Custom Taxonomy ID by Post ID
- Function get_queried_object() return NULL in custom taxonomy
- Use get_the_terms to list subcategories of custom taxonomy
- Display Taxonomy Terms in an option tag with value being the slug
- Which post does a taxonomy term belongs to?
- Get related posts of child term of custom post type
- How to bulk-untag multiple posts?
- Getting value from get_post_custom
- How can I hide tags on a child-category page, if that tag has not been used?
- Customize rel=canonical tag for single blog post
- Get posts and include taxonomy term
- Display posts of specific category term
- How to Display Posts From Category Within a Custom Taxonomy?
- Get Comma Seperated Taxonomy Linked Terms and Last Child Separated By “&” Instead Of Comma
- Change post author without using wp_update_post()
- wp_query with ajax
- Exclude product attributes from taxonomy terms loop
- Updating post meta for checkbox
- Saving Post Data in Another Database
- Get name of taxonomies of current page
- Programatically adding custom filters to post list
- How can I tell if a post has been published at least once?
- Automatic blog page with custom design [closed]
- Retrieve data from post meta meta_key having ‘_product_fq_image’ while having author_id and post type is PRODUCT
- Unable to get the Parent Custom Taxonomy Terms
- Unsetting post_tag taxonomy breaks term description for other taxonomies
- How to Rearrange WordPress Tags list on frontend using Shortcode with specific order?
- Post meta not working
- Private post caught in endless redirect loop
- Get WooCommerce product category list in functions.php
- What is proper filter or hook action to add data to the $post object?
- Taxonomy checkboxes not showing current status on edit page
- Filter “get_terms” query
- Get all posts for custom taxonomy term
- Display Updated Date Instead of Published Date
- How do you update post date (year only) in a separate custom field?
- generate random slug when adding taxonomy
- Bulk Post update_post_meta
- Loop through taxonomies and loop through their terms (Newbie question)
- Re-order Category Meta-data
- Slug collision between page, taxonomy and custom post type
- How to hide meta from search result only on pages?
- alt of attached image in post / pages
- My custom query is displaying random posts in random order
- Custom post type term names with ampersand in the term name
- Add custom class to existing menu items from custom meta
- How can add posts without category into category
- 404 for some custom taxonomy not ALL taxonomy
- display post according to the term
- Display associated taxonomy child name on single CPT page
- Taxonomy Category category.php not working
- Issue On Listing Woocommerce Parent Tag List
- Filter/Sort Post Form On Taxonomy page
- Taxonomy Archive URL + Template