Is this a sequence mismatch between the hooks?
I would argue so, yes. acf/init
gets executed by class ACF’s init
method, all in the root file acf.php – this method is hooked to WordPress’ init
with a priority of 5 like so
add_action( 'init', array($this, 'init'), 5 );
And you probably add your CPTs with a higher priority, this means acf/init
will be executed before the registering of the custom post types.
To solve this, I would hook into init
with a even higher priority (smaller than 5) to register the CPTs.
Related Posts:
- WordPress custom post type archive with description
- Validate custom fields before save using WordPress Rest API
- How to: Display ACF [fields] on Custom Post Types Utilising WordPress ‘Hooks’? [closed]
- CPT archive admin menu label
- Custom Post Type with Configurable Sidebar via ACF
- How to set a ‘page’ as parent of a custom post type?
- ACF Pro Accessing fields on a Custom Post Type
- Filter Content on all Post Types
- Filter by custom field in custom post type on admin page
- Custom post type yearly/ monthly archive permalinks
- Meta_Query as a way how to setup CPT permalinks – is it a good thing?
- get_query_var() not working in pre_get_posts
- Filter a custom field based on selection of another custom field (ACF) [closed]
- Is it possible to have an index page for taxonomy term for each custom post type it is assigned to?
- WordPress Search documentation: how to improve search query using taxonomy terms, custom meta fields?
- Hide child term posts on parent term pages
- Compare 3 custom fields and sort by oldest
- Retrieve a specific field from taxonomy term through advanced custom fields [closed]
- Alphabetical sorting of custom post type – one letter per page
- List all posts in Custom Post Type but group dynamically by Custom Taxonomies
- Custom post type archive sorted and grouped by date in post meta field
- Custom Post Type archive giving 404
- How to register custom post types in a plugin?
- Display posts if a custom field value is equal to another custom field value
- Custom-post-type-archive: posts sorted/filtered by year?
- Add the current menu item CSS class to a custom page type archive in WordPress menu
- How to use WP_Query in a CPT achive page?
- Have a Custom Post Type index page display taxonomy items instead of posts
- Post Object Filter by Custom Field, not title (ACF)
- Rewrite WordPress URL to show CPT meta field data
- Query var removed after rewrite
- Custom Post Type with has_archive ignores my custom archive and single template
- Posts are duplicating on wp_post_update
- Extending AZIndex plugin to use custom post types and custom taxonomies
- WP_Query order by custom field, then randomly order some of results
- Display custom post type category, while in a CPT category, then the posts beneath
- How to display custom post in archive section of the wordpress page?
- Filter Posts from the Main Query
- Custom Post Types vs. Advanced Custom Fields (with Repeater Field add-on)
- Specific routing for CPT
- How To Import CPT With Only Few TEXT ACF Fields From Front End?
- Custom post type archive with page as parent url
- Add a custom text to admin footer in a Custom Post Type page
- Set thumbnail and title for a post type archive (not post itself!)
- Url to archive page for custom post type
- List of users that clicked a ‘Join’ button at single post
- sortable columns for multiple custom post types not working
- set_query_params using custom params defined in functions file?
- providing access to post_id or post inside functions.php
- Batch Extract Date from post title and put into ACF custom field
- Custom Post type date archive for custom taxonomy
- get custom post type value in header.php [closed]
- adding custom post type “name” to single template
- Custom Post Type Archive template not being called
- ACF Relationship Posts how to show additional content
- comments hooks on custom post type
- Catch and display error on save_post action
- Displaying custom taxonomy menu in custom post type archive
- Pages not appearing?
- Is possible register two archive pages for single custom post type?
- How can i show ACF in post excerpts
- Using `set_transient()` when saving a custom post type
- 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
- Add html tot CPT edit screen – no metabox
- In child theme, add CPT to custom taxonomy registered in parent theme
- How to display posts with plugin (advanced custom fields) field groups?
- WordPress – display relationship between blog posts and custom posts
- Load info from customposttype into template page
- Static Front Page not working for custom theme
- ACF meta_key and meta_value break loop
- search results to show individual ACF fields from inside custom posts
- Videos Post Type with Custom Filters
- Correct way to register custom post type from external php file?
- Unsure what page hierarchy to use with CPT UI to show on front end
- Use output of wp_dropdown_categories($args)
- Only show categories that have posts within custom post type
- get first limited words from a custom post in the archive page
- Meta_query by date for Events archive
- Values show up in custom home page but not in custom post pages
- Display related post content and custom field content
- Show index and not the archive for “Dog Custom Post” with default slug
- Custom post type archive page not showing on archive-posttype.php
- How to load custom post type plugin after acf options page (or get settings from there another way)?
- Adding Information To All Posts Screen
- Customizing a plugin function using a hook
- Templates list in “Page Attributes” metabox is inaccurate
- $post breaking container loop
- Stop Custom post type from being searched via URL
- title tag for custom post type remove taxonomy name from title tag
- Collection of fields in a single post
- Pagination not working for archive
- using a template for more then 1 page
- Retrieve a post with its ACF repeater fields in wordpress
- Filter page ID outside the loop and order
- Elementor Custom Query to get Posts by ACF (Post Object Field
- Custom taxonomy meta fields
- Custom Sort Order for Custom Post Type Taxonomy
- WordPress post objects in one parent post object