You can use the_title filter.
add_filter('the_title', 'my_meta_on_title',10, 2);
function my_meta_on_title($title, $id) {
if('booking' == get_post_type($id)) {
return get_post_meta( $id, 'booking_first_name', true ).' '.get_post_meta( $id, 'booking_last_name', true );
}
else {
return $title;
}
}
Related Posts:
- Query all posts where a meta key does not exist
- what is the correct way to compare dates in a WP query_posts meta_query
- Admin Area Custom Type Search By Meta Fields Without Title & Content
- How can I filter posts by post_parent in the admin?
- How to create a mini directory in WordPress?
- Detect meta value changes when post is updated (post_updated)
- Search everything (posts, pages, tags, cpt, meta)
- Compare 3 custom fields and sort by oldest
- Reason action hook won’t work with update_post_meta from frontend form? Alternative?
- Can’t sort order of wp_query with 2 meta keys
- How to get source of custom meta image?
- update a post meta from a single table cell TablePress
- Custom Meta Boxes – Nonce Issue – Move to trash issue
- Displaying Meta Box Image
- ACF Upload Image in repeater from front-end with custom form? – add_post_meta()
- Displaying custom posts only if custom meta box’s date is not expired
- Displaying Metabox value (custom post type taxonomy)
- Meta Box Only in CPT Edit Page, Not in Add New
- get_post_meta is returning image id
- Custom Post Type, Saving Multiple Checkboxes
- get_template_part() – post-meta not working?
- Create a random unique 6 digit number as custom field for custom post type
- Export entries and multiple custom field meta to .csv?
- Metadata for a taxonomy – is there any WordPress way of doing this?
- Does WordPress limit the length of slug names for Post Meta or Terms?
- Populate Custom Fields in a Custom Post Type?
- Insert Multiple Post with Same Publish Button
- Update CPT post meta with update_post_meta and cron job
- Custom meta box data array: foreach not working correctly?
- Undefined Variable – Custom Post Type Meta
- How to check if user meta field is empty in conditional else statement
- Get posts between custom dates
- Getting meta in editor plugin, and event triggering issue
- A better way to add a meta box to custom post types
- Should wp_postmeta meta_key always be unique for a given post_id?
- How do I set all of a particular post meta to a value within the custom post type I’m in?
- Metabox not show in categories custom post type cmb2
- Storing a many to many post type relationship in post meta and keeping SQL ability for Joins
- Can’t publish custom post type – “You are not allowed to edit this post.”
- Filter date from post meta when date is in string format
- Get only used meta_values
- Is there a way to exclude posts based on meta_values?
- Submitting Custom Post Types with custom fields from Front-end form
- Get $post->ID from a URL
- Displaying a div from an assigned meta_value when on a page
- Setting Post Title via Meta Data returns Auto-draft
- How to Echo Metadata Value in Currency Format
- Filter posts by tax (dropdown) and meta value
- Publish and save specific postmeta to a filtered post_type
- Custom post type suddenly stoped working after WordPress 5 update
- Batch Extract Date from post title and put into ACF custom field
- How to show custom field on specific custom post type posts only when filled
- How to handle this specific case of custom post type?
- Save CTP post meta different values each day without overwriting previous values
- get_post_meta returns NULL in front-end, but correct result in back-end
- is_main_query() never called on WP 4.4
- Meta box data is saved but NOT displayed in the meta box text field. Why?
- Related posts meta_query CPT
- Meta box with front-end styling
- Sanitaizing Select Optin For Custom Post Type Metabox in WP
- Cannot Save MetaBox Data in Custom Post Type
- Getting WordPress to store 0 values for custom post type meta
- Say I have a tech blog, how best would I store technical specs for a phone, if i use custom post types
- Problem Saving Custom Post Type Meta Values
- Hide title field of selected post-types on edit pages
- Get_post_custom not fetching value from array wordpress
- Save data is post using php front end
- How to keep custom post type related information
- Can’t save meta box data in WordPress using custom post types
- Creating a custom post type upon registration for a specific user role
- How to sort by multiple values in a nested WP_Query
- Where is get_post_meta value located?
- How can I use a custom template to load custom post type posts based on a post_meta value
- How do I create a customised table list of a custom post type (in the admin area)?
- How to properly get the wp_postmeta.meta_value of a custom post type in specifics?
- How to save post_status using action save_post?
- Custom post meta box as a sub form
- Metaboxes in Loop
- Custom meta box data not saving
- Collect custom post in a calendar
- Storing data in a multidimensional array from dynamically generated foreach loop
- How can I get the $key / $value pairs of custom fields that were added via 3rd party plugins or themes?
- meta query always fails even if data is correct
- Values inside a custom field to determine which category posts to display
- Display a post count from a custom metabox selection
- How to rewrite CPT-Permalinks the correct way (incorporating meta-box-data)?
- Custom post type submenu sorted by specific meta_key & meta_value
- Advanced search form with filters for custom taxonomies and custom fields
- Top 30 Songs using Custom Post Type
- Advice Needed for Post Meta Database Efficiency
- Querying meta values within an array
- Post AND page parameter for WP function
- why get_post_meta is returning 0?
- Save post_parent in a custom post type
- How to display Author Profile based on Custom field value
- Automatically add custom taxonomy when meta value gets to a set number or beyond
- Display a list of posts whose meta field values are equal to the ID of the post being viewed?
- Update an existing post in a custom post type
- Check for custom field value in different post type than current one and do something
- I am having a problem with fetching product data in the Gutenberg block editor