I wasn’t adding the ID into the new array.
if ( get_post_type( $post_id ) == 'equipment' ) {
$my_post = array();
$my_post['ID'] = $post_id;
$my_post['post_title'] = get_field( 'name', $post_id );
wp_update_post( $my_post );
}
Related Posts:
- Automatically fill custom field value on post publish/update
- save_post affect creation and deletion
- ACF – Updating all posts of CPT when a custom field from options page is updated
- ACF repeater field usage
- Programmatically change post visibility on save_post action return a 500
- List of users that clicked a ‘Join’ button at single post
- Post loop count is not in order
- How to inherit field value from parent post into in child / sub post
- How can I add a shortcode to query Custom Post Type with ACF in WordPress?
- Custom Post Type page sorts differently on different environments
- Postname on unique permalink structure appends “-2” for a custom post type. How can I get this to stop happening?
- set_query_params using custom params defined in functions file?
- Why does wp_update_post causes white screen?
- Custome fields not displayed
- Update post if exist from PHP
- Create short URL with auto 301 redirect
- ACF for custom post type archive pages: which hook to use?
- How to define the template for custom posts?
- Batch Extract Date from post title and put into ACF custom field
- Query entries from custom post type in an ACF flexible content field
- Why is wp api returning old acf values?
- How to use single.php for creating, reading and editing Custom Posts with ACF
- Distribute Custom Post in different pages
- get custom post type value in header.php [closed]
- posttype and custom fields on multisite
- How do I get_the_postID() for a custom post that uses ACF repeater field?
- How do I replace the post title with a custom field?
- Advanced custom fields Post Object image field not displaying in custom post type single.php
- Sum and count of custom field values
- How do I show a link or ‘Read More’ button on a custom field excerpt when it is less than the word limit
- How to export custom post type with ACF to individual file with automation?
- Custom fields not showing in custom post type
- Odd behaviour for the update button when displaying a WP_List_Table
- Group by custom field value (start and end times)
- Custom post types, disable fields
- meta query not retrieving posts
- Custom Post Type with Configurable Sidebar via ACF
- Get A Custom Field From A Custom Taxonomy Of A Custom Post Type [closed]
- Custom Sidebar in Editor (not Widget) for Custom Post Type in Genesis
- ACF Relationship Posts how to show additional content
- wp-includes does not contain a feed template
- Using WP meta query to show custom post types by a start and finish date
- Limit search field to just search a custom post type with custom fields
- Advanced custom field – posted fields from custom post type
- Excerpt length: get first paragraph
- How to keep a record of changes to a custom field?
- SQL query – get ids – Advanced Custom Fields / WPeC
- Custom field with Types: get custom field’s value label (of type select)
- How to display author details in a custom post type in the wordpress backend?
- Show posts associated with ACF post object and custom post type
- Show/hide posts and categories based on user meta
- Fetch data from two custom post types and create multidimensional array for output to html table
- Having a repeating custom field in admin custom post type, what I’d go better with, for DB’s sake? ACF repeater or query a different post type?
- How can i show ACF in post excerpts
- ACF – Retrieve custom taxonomy from a relationship field
- How to set a ‘page’ as parent of a custom post type?
- Custom front-end form for adding post – Category problem
- Set up a WP Cron scheduled event to update calculated ACF field
- Query filter by value in meta_value array
- Show Post Revisions on front-end
- count & sum the value of custom field of the author post in dynamic posts
- How to show Custom Post Type – Case Study using Shortcode & ACF
- Add custom post related by custom field to custom post
- Create if else for post types in WP_Query ‘post__in’ values
- Create loop from selected terms in ACF taxonomy field
- Sort custom posts by date and then by taxonomy
- Grouping custom wordpress post types by acf value
- Set Post Private if no linked Post Objects (ACF)
- Show in an entry a Custom Post Type associated to a post
- Orderby custom fields is not working
- Custom post ID & display information related to this ID
- Using ACF values in nested WP queries for CPT with date values in the past
- Create/populate Custom Posts ACF fields from external JSON file
- Expire post to draft by date-picker custom field
- Updating a custom post status after an expiry date rather than trashing it
- WordPress URL rewrites using Advanced Custom Field
- Custom Post Type and Structure Question
- Display a Custom Post Type with Advanced Custom Fields on Homepage
- CPT email notification including only new value custom fields
- Filter result of Custom Post Type using meta_query with ACF
- How to display posts with plugin (advanced custom fields) field groups?
- WordPress – display relationship between blog posts and custom posts
- Same custom post type with different ACF
- Query posts by current ACF meta key value on single page as related posts
- Custom sorting in post columns by ACF Pro Select Field
- Load info from customposttype into template page
- Show custom post type event if current day using ACF
- Display Custom Field or Custom Taxonomy in front page /post/product
- Why do my custom post types stop displaying over time?
- WP_Query not using custom taxonomy categories on custom post type
- How would i insert a value of custom field from Advaced Custom Field into shortcode generated by Gravity Forms [closed]
- Issue to display Permalink (ACF Relationships in Custom Post Type )
- Auto generate excerpt from ACF field on a CPT that does not support excerpt or content
- How to access repeater field of a custom field?
- Filter posts by their related field’s custom field
- If ACF Post Object post has custom taxonomy term…
- Subpages URLs for Custom Post Type
- ACF Pro Accessing fields on a Custom Post Type
- Custom post type not pulling CSS
- Modify Publish Metabox location on CPT