(0. Retrieve the meta value with get_post_custom
(in order to highlight the selected value in the select input).)
-
Query posts with
get_posts( array( 'post_type' => 'services', 'post_status' => 'publish' ) )
-
Loop through the results with
foreach
and build your select input. -
Hook into save_post (
add_action('save_post', 'my_save_meta')
to store the selected value (withupdate_post_meta
).
Related Posts:
- Custom Post Type with Input fields to seperate table on database.
- How do I remove all the metaboxes for a custom post type?
- Detect meta value changes when post is updated (post_updated)
- How to select one major category (or custom taxonomy) for a custom post type?
- Having trouble with custom post type / meta box
- How can I include meta box content when searching?
- update a post meta from a single table cell TablePress
- update custom post type meta from a shortcode
- Custom Meta Boxes – Nonce Issue – Move to trash issue
- Displaying Meta Box Image
- How to keep a check box in custom meta box for custom post type checked by default for add new post?
- How to add multiple featured image in meta box in post editor?
- Show metabox in custom-post-template depending on taxonomy term?
- Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
- Displaying custom posts only if custom meta box’s date is not expired
- Displaying Metabox value (custom post type taxonomy)
- How can I display my custom metaboxes on a custom post template?
- Meta Box Only in CPT Edit Page, Not in Add New
- get_post_meta is returning image id
- Custom Post Type, Saving Multiple Checkboxes
- Populate Custom Fields in a Custom Post Type?
- Custom meta box data array: foreach not working correctly?
- Undefined Variable – Custom Post Type Meta
- Populate dropdown from one custom post type inside another custom post type
- How to check if user meta field is empty in conditional else statement
- Why is my select meta data not saving?
- Widget: Custom Post Type Post Listing Dropdown on Admin Side
- A better way to add a meta box to custom post types
- Metabox not show in categories custom post type cmb2
- Show Custom Post Type meta boxes only on Page Edit
- Can’t publish custom post type – “You are not allowed to edit this post.”
- Sizing textarea field in custom metabox
- Meta Data for Custom Post Type not saving
- create custom meta box with default value
- Displaying a div from an assigned meta_value when on a page
- How to Echo Metadata Value in Currency Format
- Issue on Working with Metabox – Checkbox to enable Sale Items
- Why do I have to press the “Update” button twice to save my meta box values?
- Values from meta-box not on $_POST
- Metabox multiple custom post select -> display selected items?
- Custom post type suddenly stoped working after WordPress 5 update
- How can I output WPAlchemy repeating fields meta values in my page template?
- Meta box data is saved but NOT displayed in the meta box text field. Why?
- Save Metabox Custom Field Value
- Meta box data not saving
- WP_Meta_Query object with conditionals
- Related posts meta_query CPT
- Meta box with front-end styling
- Sanitaizing Select Optin For Custom Post Type Metabox in WP
- How to retrive Custom Post Type Meta Fields in Custom WP_Query
- Cannot Save MetaBox Data in Custom Post Type
- Add a class to post_class if more than one post shares same meta_value_num
- Function to return values from metabox
- Add a meta field to the list of results for a custom post type
- Empty meta-box returns publishdate if no value is set?
- Custom Post Type Meta Box Text Input Field Won’t Save When Blank
- Custom Meta Box with variable number of fields
- Custom Post Type meta data getting deleted on bulk editing taxonomies
- Get meta values from parent post and save in child post
- Metaboxes in Loop
- Custom meta box data not saving
- Collect custom post in a calendar
- Delete custom post type metadata without deleting the post in admin area
- Problem with ‘save_post’ hook not running
- Edit post meta direct from post.php?
- Howto: use existing post_meta as options for a different metabox (checkboxes or list)
- Display a post count from a custom metabox selection
- Post AND page parameter for WP function
- Use a Variable in update_post_meta as the $meta_key
- Issues on saving data from CPT select metabox
- Cannot save CPT meta box
- How to make custom taxonomy into drop down select in a custom metabox
- Adding Page Templates to post but it ignored it
- Parent Page and Breadcrumb URL’s for Custom Post Types Not Working
- Create a Dropdown from Custom Post Type
- Translating custom post type metaboxes [closed]
- Adding a metabox on a CPT’s submenu page
- Custom filter function not working with Custom post type
- Fixed values for same post translations
- How to Add multiple instance of meta box to custom post type
- Using POST method in meta box, no results
- meta box on custom post type
- Checking if $_FILE isset for an array of file upload metaboxes
- Importing Data from a Non-WordPress database, into WP
- Ordering values entered in Custom Taxonomies
- Getting thumbnails of a custom posts featured images in a page-templates metabox
- Listing custom terms in custom post meta
- Permalinks: custom structure for taxonomy – tags?
- List Taxonomies: Don’t list taxonomy if it has no post – depending on custom post-meta?
- Custom Post Type & Meta Box – Displaying meta box information on front end?
- Remove Post Custom Meta Box
- How can I move (or create another) publish button?
- Wrap meta boxes & data handling for specific post types in classes?
- Can custom fields be added without a meta box?
- Meta Box on Custom Post Type not saving
- Custom fields for custom post type
- Show future events based on custom field AND order by date
- Custom “radio button meta box” not saving correctly
- Global custom meta box
- Moving meta boxes in admin