wp_insert_uses (trac) the following loop to handle meta_input
,
if ( ! empty( $postarr['meta_input'] ) ) {
foreach ( $postarr['meta_input'] as $field => $value ) {
update_post_meta( $post_ID, $field, $value );
}
}
So if you change meta_input
in your new post args to be like this,
'meta_input' => array(
'invocies' => array(
'service' => $_POST['service'],
'price' => $_POST['price'],
'status' => $_POST['status'],
'client' => $_POST['client'],
),
)
I think the data would then get saved correctly.
Related Posts:
- How can I load a page template from a plugin?
- How can I add an option to the Page Template list from a Plugin?
- Get List of Registered Meta Boxes and Removing Them
- How to add tab which is visible only in admin side of product in woocommerce? [closed]
- Dashboard like meta boxes in my plugin – how to save their position and open/closed state?
- Save metabox with multiple checkbox array
- How to Use WordPress Color Picker API in Custom Post Type Metabox
- How to create Image gallery Metabox in wordpress [closed]
- How to create custom home page via plugin?
- Conflicting save_post functions when passing the post id and saving custom meta boxes for different post types
- Dynamically override page.php or single.php with custom templates using function
- Is it possible for a plugin to register a page template file?
- How to add meta boxes to the ‘Add new post’ screen?
- Calling a function from functions.php in custom page/ blog post
- Build dynamic page from cURL (HTML page) response with plugin
- Load page template with custom content using a plugin
- Rearranging Dashboard meta boxes with use of plugin/functions.php
- Plugin admin page meta_box toggle and order state not saving
- How to Add Page Template from Plugin without Losing $this
- Metabox Not Showing on Custom Post Type But On Pages and Post
- Dequeue theme stylesheets but keep widget styling on custom page template
- Best choice of options/settings framework for plugin/theme development
- How to display non-page / post content
- Admin auto-refresh is interfering with Firebug — how to prevent it?
- Show add_meta_box by selecting a specific category
- Change template dynamically
- update post meta for checkbox in the admin when inserted in the front-end
- Problem with parameters in url and pagination
- Set page template programaticlly in plugin
- How can I pass get_the_author_meta(‘user_email’) through the REST API?
- Can Page Templates be Applied to Archive and Post Templates?
- Custom Taxonomy to dropdown box on adminside wordpress
- Create & Save multiple Meta-boxes
- Add a Save Button to Custom Meta Box [duplicate]
- Dashboard – get status and position of metaboxes and pass them to ajax method
- Getting List of all registered Dashboard Widgets
- what is the difference between these phares?
- How to get Metabox custom field to show checked if value is updated using post meta query?
- How do I update a field of a meta box?
- Input value from metabox is not found in $_POST after post save
- Including comments meta box on a plugin page
- Custom Plugin theme filter
- How to add a widget to the post editing view?
- Adding admin menus to wordpress
- Remove sidebar on single page using plugin API
- Automating the process of shortcode generation in a plugin – how is it done?
- Meta box on options page save form problem
- my basic php code producing unexpected results
- Moving/dragging a metabox removes TinyMCE’s content
- Store custom meta box data as serialized array
- Create page (not the post type) dynamically
- WP nonce field checkbox prints checked=’checked’ outside input field
- How to add custom post widgets as tags into wordpress
- How to output functions from plugin inside theme
- Best way to distribute templates and code accross multiple wordpress sites?
- Any way to update_post_meta with html content? It gets stripped and becomes empty
- How to remove/replace current page template?
- Load php file with jquery in single.php
- Adjust query on single
- Can I attach a plugin via my add_filter callback contents?
- Metabox is not displaying
- Catch metabox values in Plugin
- want to show CMB2 metabox on woocommerce product data tab
- Why is $_POST empty when saving custom Meta Box?
- WP_List_Table Inside Metabox With Bulk Actions Not Working on Submit
- Save meta box data from selected dropdown list in bbpress reply form
- Metabox types list
- Conditionally check if page is using template from plugin directory
- WordPress Filesystem create CSS-File – get Shortcode ID for Name
- add_meta_box does not display meta box in Admin
- Add WordPress Meta Box saved form input to WordPress RSS feed [duplicate]
- set a custom post type to a taxonomy term programmatically in metabox
- Change Front page displays settings conditionally when user is online
- Can’t create a blank template
- Dynamically getting tags in post edit screen
- Code to add template to page
- Page template compatibility with different themes
- How to show metabox just in post.php in admin?
- Plugin dev: How to multiply instances of a plugin in the same metabox?
- save_post not called in plugin / custom field still saving overwriting metaboxes
- Get fields of a widget
- Display Data’s metabox in page
- Show Metabox Images in slideshow instead of static
- How to set/change another post author by custom fields or something else?
- Using a Page Template Not in Theme
- Find Any Theme’s page.php File
- Saving metabox updates causing fatal error
- REST API error in block editor for custom templates
- Generating Multiple Divi Pages from Database
- get_template_parts() usage
- Objective Best Practices for Plugin Development? [closed]
- add_menu_page() with different name for first submenu item
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- How to include PHP files in plugins the correct way
- How can I add an image upload field directly to a custom write panel?
- A tool to analyze rewrite rules? [closed]
- Difference Between Filter and Action Hooks?
- framework for plugin/theme options panel? [closed]
- Creating a table in the admin-style?
- How can you check if you are in a particular page in the WP Admin section? For example how can I check if I am in the Users > Your Profile page?