Instead of creating a new tag, I would suggest just writing code to create the slug on a per-post basis using ACF’s save_post function.
//Update Cars slug field:
function wpse_post_slug_updater( $post_id ) {
if( get_post_type() == 'cars') {
$my_post = array();
$my_post['ID'] = $post_id;
$my_post['post_title'] = esc_html(get_the_title($post_id));
$my_new_slug = get_field('brand') . ' ' . get_field('license_plate');
if(!empty($my_new_slug)){
$my_post['post_name'] = sanitize_title($my_new_slug);
wp_update_post( $my_post );
}
}
}
// run after ACF saves the $_POST['fields'] data
add_action('acf/save_post', 'wpse_post_slug_updater', 20);
Related Posts:
- post_type_link filter causes 404 on the CPT page it’s used on
- Maintaining WP_Query Relation Among CPT, Custom Taxonomy, Permalinks- CPT UI
- Remove POST_TYPE from custom post type permalink
- add category name to permalinks on product page /category-name/product-name
- How to set a CPT to have a page as a parent, then rewrite urls accordingly?
- How to change permalink to include custom post type
- Passing variables through permalink structure in custom post types
- Custom post type 404 error on “default” or “numeric” permalinks
- Custom Post Type Permalink / Rewrite not working immediately
- How to remove /blog/ prefix for custom post types in permalinks?
- How to add custom content template part for a custom post type on main query using a plugin
- WordPress Custom Post Type is Matching on Partial Slug
- Change slug of registered custom post type in child theme
- echo value from ‘select’ field type into page template using cmb2?
- Custom permalinks
- Permalink for CPT with taxonomy
- Custom post type permalink changing itself every other change
- Add links to post categories and taxonomies in wysiwyg link modal?
- Add Capabilities to Custom Post Type after it has been created [duplicate]
- Custom Permalinks for Custom Post Types and Taxonomies
- Removing parent slug from URL on custom post type
- Custom post type category, taxonomy and URL rewrite problem
- Rewrite on custom post type permalink not working?
- How to get the custom page get_permalink?
- Custom Post Type: How to display all of same taxonomy?
- Custom post type permalink missing /post_type/ front
- Custom post types and permalink
- custom post type default permalink
- Custom post types, taxonomies, and permalinks
- How to specify URLS for custom posts & taxonomies
- How does the $post_type global variable work?
- Permalinks not working for custom taxonomy on custom post type
- Can’t get order_by meta_value_num to work properly
- Show listings from Impress Listing plugin in random order using taxonomy and terms
- One-to-many post relationships that are displayed by category (using posts-to-posts plugin)
- Custom posts don’t work
- single-{cpt}.php ignored
- Custom Post Types. Are there any disadvantages/advantages in using a plugin to develop them?
- Custom Post Type permalink shows wrong page: homepage/index.php
- Get term name and term parent into custom post type permalink
- Rewrite rules for custom posts types
- Does WordPress consider a post name unique if that same post name is in multiple Post Types?
- ‘No Results Found’ on single post for custom post type
- Addition of custom option panel crashes Media Library & Admin Area
- Custom post type as home page with custom url
- URL rewrite add author as base
- WordPress randomly shows 404 errors
- Custom Post Type slug same as page name
- How to Get WordPress custom post data in WooCommerce product meta panel? [closed]
- Parent Page and Breadcrumb URL’s for Custom Post Types Not Working
- CPT’s with landing page instead of archive – Url Rewrite?
- Hierarchical permalinks for custom post type and taxonomy
- How to organize hierarchical structure in custom post type with taxonomy (like with categories)
- Remove permalink for custom post type
- Best way to specify “article type” in URL
- How to have permalink like domain.com/term/postname?
- Pagination hitting 404 page on /page/4
- Custom post type permalink returns 404 when set to private
- Add custom field to admin area witthout using a metabox
- Post type Permalink
- Can I assign a theme to a custom post type?
- Create Custom Post type that uses Page.php template
- Custom Post Type with Configurable Sidebar via ACF
- How can I modify a custom post type and custom page template for a child theme if all content seams to be handled by theme’s ‘native’ plugin?
- wordpress post_where set only for my costum post type
- Setting a homepage – doesn’t seem to work
- Improve Custom Post Permalink Structure
- Using page title as a link to term archive
- Pagination does not work on Custom Post Type archive while trying to get load more function working
- How to mass get post editor URLs
- Error 404 change permalink term custom term taxonomy
- WordPress URL rewrites using Advanced Custom Field
- Preview url not working outside wp-admin
- Custom post type defaults to index.php for archive page
- Set a template on a custom post in the plugin
- Simple way to hide\show an announcement (just a div) on homepage?
- Restrict Custom Post Type to One Item
- Adding categories to custom post type in permalink
- Link two different post using there post_id in post meta
- Custom post type that lets users create a set of posts?
- Pretty permalink structure with multiple (AND OR) taxonomies
- 404 custom post type
- Remove custom post type generated by a plugin (The Events Calendar) [closed]
- Show custom taxonomy not in submenu
- Custom post URLs
- Loop carousel slider in wordpress
- How can I add a “fake” parent into the permalink?
- Custom Post Type Archive Links Not Working
- Custom Post Type Categories Not Maintaining URL structure any more
- Add category slug as class attribute in a link array
- Get post id of permalink for a specific custom post type?
- URL Rewrite Adjustment for Custom Post Type causes template to revert to index.php
- Add taxonomy to custom post type archive
- Custom Post Type – Rewrite slug [duplicate]
- Custom Post Type Permalinks with %category%
- Custom post type – permalink
- Custom post types permalinks not working
- Rewrite rules for using the same base slug for multiple content types
- How to get ‘Products’ on home page?
- Custom post type with custom parent prefix slug