Assuming the $value
actually returns a post’s ID. Replace the code
wp_add_post_tags( $post_id, $value );
With
wp_add_post_tags( $post_id, sanitize_title( get_the_title( $value[0] ) ) );
Related Posts:
- clients list using wordpress
- echo value from ‘select’ field type into page template using cmb2?
- Find callback function for custom taxonomy metabox
- Detect meta value changes when post is updated (post_updated)
- Search everything (posts, pages, tags, cpt, meta)
- Search Custom Post Type with all meta attached?
- Automatically assign a custom post to a custom taxonomy based on custom field value
- Exclude Custom Post Type & Pages From Auto-Tag Function
- Saving multiple Metabox contents
- How to add the post ID (or any other post data) to a Contact Form 7 mail?
- Create a post in custom post type using field in registration form after users submit form
- Copy custom field value to post title
- search also in taxonomy, tags and custom fields
- get_post_meta not working on publishing
- Homepage’s content is dependent on the custom field values (set automatically), how do I get homepage to update without manually updating page?
- Cannot save CPT meta box
- Cross reference custom post types
- Warning: Invalid argument supplied for foreach() [closed]
- ACF in wordpress
- How to inherit field value from parent post into in child / sub post
- Custom post type in Custom widget – $listItem
- Custom posts – tag pagination
- Let users upload image(s) to the post from front end
- Excerpt length: get first paragraph
- display custom portfolio tags
- Custom Form / Search with Custom Post Type Data
- CPT tags not showing when editing post
- Problem with multi checkboxes value in metabox?
- Populate custom post type/custom fields from an external database
- Custom Field to post_title
- Function not pulling image or text from custom post type
- I want to split this into two functions
- Allow authors to create article image
- How to display *block number* instead *date value* on WordPress posts?
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- WP All Import – Using Xpath to set a select value
- How to change post featured image using a custom field of category?
- Publish an XML feed from a CPT with ACF fields?
- wp_insert_post generates endless posts
- Adding dropdown select meta box to custom post type – seems restAPI is interfering
- Remove standard meta boxes from custom taxonomy
- Can’t query tag and post_type at the same time
- How to create shortcode to display custom field value on a custom post type
- Group posts by custom post type
- Confusion regarding Nonce & using it in Custom Columns for Saving Checkbox Value to Post Meta
- Tag page with Custom Post Types not returning any posts
- Automatically update custom field in all posts of a custom post type
- What’s the difference between same wp functions get_posts(); functions in different form?
- WP_Query: include custom post type only with specific meta value
- I did group my search results by post type, but how can i give each of them its own order?
- Is there a way to get a file URL from the relationship ACF field?
- Display custom fields on post excerpt or teaser
- Dequeue scripts and styles only for specific custom post type
- WP_Query orderby modified to include custom meta changes
- Function to display custom post type on front page makes menu items dissapear
- WordPress custom loop filter by meta_key and value with serialize data
- Adding Show Less/More link to Custom Post Meta
- Returning a list of custom post types excluding those without a specific meta_value
- Want to Add Custom Fields for Uploading video to WordPress Users from front end
- custom post type not showing in menu
- Keep display metadata value on backend – Custom Metabox
- How to bulk copy custom fields between custom posts?
- Show category ID on custom post type
- Sorting custom post type columns with external data and without meta values
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- Meta Key Value in current-user-only loop
- How to customize a permalink (URL) structure?
- Retrieve value of a category’s custom field
- Calculate all custom field values in the post loop
- Rewrite and custom post type: order by custom field not working
- add custom field to custom post type
- How to set up multisite for multi language?
- CPT Group by Date metabox Value
- How to check if user meta field is empty in conditional else statement
- Replace text in post from cvs
- Admin search ACF relationship
- wp_query check if integer exists in custom field’s array
- Custom post types and tag archive pages/permalink structure issue
- Tag Archive for Custom-Post-Type Posts yielding 404 when permalinks set to postname
- Custom Post Type with Templates using Meta Boxes?
- How can I dynamically add a post to a custom post type which uses a custom field?
- Can I list a custom post type within another custom post type in the admin area?
- Change custom post type slug from plugin options
- Filtering custom post type on a combination of custom taxonomies and custom fields?
- Custom Posts Types as Custom Fields
- Get image post ID in media upload
- Why is my select meta data not saving?
- dynamically add a custom field or metabox to custom post type [duplicate]
- Give a permalink to Custom Post Types without title
- Role scoping for contributors down to the field level
- How to implement a Google map store locator
- Creating a Custom Post as a repository for theme constants
- Random image from tag/custom type on sidebar
- Can’t edit custom post type
- How to stick custom post at the top in search results
- Custom post type getting wrong categories and tags
- How do I create custom fields for multiple post types?
- Add field to all custom post types
- Listing tags from a custom post type
- Query & Order posts by custom fields