The 10 is the priority, 2 means that two variables are passed on to the function ( $column, $post_id ). I think the problem is trying to echo get_post_meta
directly.
Try this:
function custom_employee_column( $column, $post_id ) {
switch ( $column ) {
case 'location' :
$metaData = get_post_meta( $post_id , 'location' , true );
echo $metaData;
break;
case 'age' :
$metaData = get_post_meta( $post_id , 'age' , true );
echo $metaData;
break;
}
}
Related Posts:
- How do I set the default admin sort order for a custom post type to a custom column?
- Add custom column to custom post type overview in backend
- Make a custom column sortable by a value from a different custom post type
- Default custom column to off
- Help Creating a Slideshow Custom Post Type with Custom Meta Boxes?
- Custom field values deleted when trashing custom post type
- Search multiple custom fields by using meta_query
- Custom Post Type – Taxonomy Dropdown Menu?
- Retrieving values of custom fields in Quick Edit mode
- Custom Post Type with Custom Title
- How to create download links based on Custom Fields with Rewrite API
- One to many custom post relationships
- Backend search; include CPT meta?
- Use Custom Post Type as Custom Field
- WP_Query on custom post type not displaying, multiple loops & get_template_part
- Saving multiple Metabox contents
- How to Sort Custom Field Admin Column by Date
- How can I customize “Pages” admin (edit.php) and “Edit Page” admin (post.php) for bulk edit of custom content type?
- Custom post type / custom fields
- Custom post admin filtering by post meta (the date)
- Admin Column Text Positioning
- Add Post Url to Manage Edit Screen
- Take Variables Set in Functions.php and Echo Them Inside My Custom Post Template
- Assign Taxonomy Based on Custom Field Value
- Customize permalink when creating a post
- wp_query to find posts by year and month
- Assigning the same custom meta box to multiple post types
- meta_query compare >= not working but
- window.send_to_editor and jQuery .attr() conflicts with multiple custom upload image meta boxes
- Save an array from drop-down in custom meta box
- Including Custom Meta with posts_where query
- How to create shortcode to display custom field value on a custom post type
- How to set up multisite for multi language?
- Adding HTML tags or css classes to admin columns
- Filtering custom post type on a combination of custom taxonomies and custom fields?
- Creating a Custom Post as a repository for theme constants
- How do I associate a custom post type with another through a taxonomy or storing an ID in a custom field?
- WP CPT Custom Sortable Column in Admin Dashboard Sort Order Random
- Orderby CPT custom fields not working
- How to show first name and last name in custom post type columns
- Show custom post type relationships by taxonomy
- get_post_meta not working on publishing
- How to create a custom post type with additional fields?
- Hierarchy and access control for Custom Post Types (CPT)
- Fields for different parts of a page
- Facebook social publisher and custom post type fields [closed]
- Searching Custom Fields
- Custom Post Meta from custom metaboxes is randomly being deleted
- How to get specific post meta by title or id
- Pods CMS: How to add custom column to Adnvanced Content Type
- Populate a custom field dropdown with post titles by author
- echo selected value from dropdown
- Category Search / Custom Post Type search on my website. Custom Post Types that are “page-like”?
- Get data from PHP to JavaScript to set position of each post on front page
- add post meta value
- Get custom term meta problem on single post type
- Filtering custom posts by custom fields (ACF) [closed]
- Incorrect ordering of custom post type based on time
- How can I see a list of products that I have set to outofstock through a custom field check box?
- CPT Repeatable Fields + Undefined Index
- Filtered by a custom field, ordered by another
- delete duplicate meta_value with same post_id
- Search CPT Title AND Meta
- Custom field only on custom post type?
- Writing a custom Glossary plugin
- Filter search posts by post meta?
- Adding a location field to buddypress activity
- Sort custom post column by generated value?
- How to only display all posts to a custom User Role?
- Unable to gather Image URL from Custom Post Type’s; Custom Meta Field
- Filter posts by their related field’s custom field
- register_rest_field update_callback don’t work for $_FILES
- How to convert Post Object Custom Field into Tags
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- Query a Custom Post Type using SELECT that has ACF fields to compare dates
- I want to create a metabox under custom taxonomy
- How can I register multiple custom post fields to json?
- Sql Update CPT from publish to draft and particular custom field
- Filter custom WP_Query by first letter of a custom field – hopefully using Search and Filter Pro?
- sorting in wp query based on custom field value
- check_admin_referer not working in custom meta box for custom post type
- WordPress loop add heading before first of type
- How do i create user accounts from custom posts that have email addresses
- How to display all custom fields associated with a post type – IN THE ADMIN AREA?
- Best way to use Category & Custom Fields?
- How do I add custom fields to posts without having to manually add everytime I post?
- How to display custom post type ordered by a custom field date
- Setting a custom $query->query_vars[‘meta_key’] breaks the WordPress menu
- WP_Query and two custom fields returns no posts
- Is it good practice to search for custom posts based on custom field values?
- Custom post type with custom fields enabled, is there a way to set a default group of fileds?
- Storing/querying custom date data
- I want to split this into two functions
- Repeatable Custom Field for Media Upload
- How to store datetime from custom meta box so that it can be sorted by
- Custom Post type easy way for editors
- Adding a custom field after post title (ex.Example Title [30 Second Read])
- Send email on creation of custom post type and use get_post_meta()
- pre_get_posts causes Custom Posts appear under ‘Pages’ menu
- WordPress does not show the custom fields box