Try debug
add_action('save_post', 'add_fields_contest', 10, 2 );
function add_fields_contest( $id, $post ) {
require_once(ABSPATH . 'wp-includes/pluggable.php');
if ( $post->post_type == 'contest' ) {
update_post_meta( $id, 'userid', $_POST['userid'] );
update_post_meta( $id, 'title', $_POST['title'] );
update_post_meta( $id, 'name', $_POST['name'] );
update_post_meta( $id, 'age', $_POST['age'] );
echo 'Saving data to post id: '.$id;
var_dump($_POST);
die();
}
I will recommend “Advanced Custom Fields” plugin
Related Posts:
- How to Add Custom Taxonomy To Woocommerce Plugin
- Prevent trash/delete action on specific post types
- How to add custom content template part for a custom post type on main query using a plugin
- register_taxonomy with multiple object type and update_count_callback
- How often do you need to register_post_type?
- How to use a dedicated template for the Custom Post Type from a plugin?
- Remove POST_TYPE from custom post type permalink
- How to register custom post types in a plugin?
- How to append element after thumbnail
- How to have the right design for a custom post type without accessing themes
- Custom Post Type | Fatal Error on register_post_type()
- Set object terms not working on plugin activation
- custom post type not showing in menu
- Custom posts don’t work
- Adding a custom post type taxonomy template in plugin
- Addition of custom option panel crashes Media Library & Admin Area
- How to Get WordPress custom post data in WooCommerce product meta panel? [closed]
- Custom fields for custom post type
- ACF in wordpress
- post_parent in custom post type
- Unable to format dates to put in event calendar
- Custom post type in Custom widget – $listItem
- Validate Custom Post Type fields
- Types plugin custom post add_action hooks
- how can i show a google map in custom post type
- Restrict Custom Post Type to One Item
- Custom Post Type Front Page Gives 404
- Show Post columns to specific users on condition
- Insert custom taxonomy into category query
- Run query on specific admin options page and send results to select field in another function
- Custom post type that lets users create a set of posts?
- get_post_types doesn’t work in plugin
- Add Excerpt On Quicksand Plugin
- Custom Post Types in plugins?
- Is flush_rewrite_rules necessary when creating a custom post type? Why?
- Unable to filter on field on edit.php page
- WP Query group/order by category name
- Using posts and postmeta table to store custom Address Book Plugin data
- template_redirect not working, apparently for no reason
- handling csv data with a custom post type
- GravityForm: Populate Dropdown with custom post type [closed]
- “add_post_type_support” with Custom Post Type & ACF
- Custom Post Type rewrite
- Admin notice not displaying
- WooCommerce product search titles only
- Loco Translate: Custom Post and Custom Taxonomy Labels not translated in wp-admin menu
- Insert Multiple Post with Same Publish Button
- Plugin: register custom post types, child ready and performance best practices
- How can I make a custom post type sticky?
- Getting meta in editor plugin, and event triggering issue
- Broken featured images are uploading from frontend
- limit value taxonomy based on previous taxonomy value wordpress
- How to change wp prefix for custom post type only?
- Metabox not show in categories custom post type cmb2
- How to use TinyMCE Editor for one of my custom post meta field?
- How to Create a WordPress Plugin With Custom Post Type/Custom Field Features?
- Deleting taxonomy terms and relationships on a custom post_type when a user is deleted
- Custom Post Archive is not working
- Save Multiple Metabox values
- Create metaboxes based on custom post type
- How to add and clear custom post types and taxonomies in a plugin? Considerations for existing data
- What’s an efficient way to change the post status of many posts at once?
- How exclude or skip post type with get_next_post_link
- Getting only one post per category
- CMB2 metabox create select with list of post from CPT
- Problem with adding custom post type meta to header by plugin
- Creating alternate meta box context locations
- Custom post types, disable fields
- Plugin generated unexpected output – No PHP errors
- Not Able to Add New Class To CPT Attachment Image
- Orderby custom fields is not working
- custom post type plugin error [closed]
- How to stop the custom post type URL from the google search?
- How can i display a taxonomy? i have created a plugin and then a custom type. and a taxonomy , also i have register it
- Changing CPT permalink
- Get all posts by many custom post types
- Warning , Use of undefined constant PLUGIN_PATH?
- How to show link to product in custom fields?
- Error when moving custom post type to bin
- Admin metabox with custom post type dropdown option not update choosed input after saving
- Having issue on Loading Meta Data From CSV to CPT
- custom data model – link and populate from admin backend
- CPT UI: Connect a custom post type to a custom post type
- Looping through image object using ACF and CPT UI [SOLVED]
- php output of generated custom metabox
- Post that populates itself (almost) automatically using data from imported excel file
- I broke it! Custom post type archive gets redirected to home
- Adding CPT changes entire layout of my site except for the archive of that CPT
- Registering an optional custom post type from a plugin
- Custom Info Box at end of posts?
- Generate custom RSS from a plugin
- How to add jquery to my custom post type wp plugin
- Synch Custom Post Types (and Custom Fields, Cats, etc.) Between WordPress Sites
- How to add post type in masonry posts elementory widget
- Remove plugin’s custom post type archive page and single pages [closed]
- How to delete unnecessary custom post types in the UI
- add_filter > posts_where works partially
- How to change post cpt with submit button?
- Custom Post Type featured option
- How to provide page_template path in custom plugin using WordPress