So it looks like the OP figured it out over at: https://wordpress.org/support/topic/adding-a-custom-field-in-addition-to-post-name-to-permalinks?replies=22
However, I have a similar situation. If I should open a completely new thread then please let me know but I’d like to use an ACF Pro Relationship field to prepend to my CPT. Here’s my situation:
I have a CPT “Team” with a relationship field that allows you to select multiple values for the CPT “Player”. The URL structure of the “Team” CPTs looks like “/teams/darkside/12-darkside” for the team named “12 Darkside” and the category “Darkside”. I currently am using code that I posted over at wordpress.org.
The code updates the permalink of the “Team” to use the structure “/teams/[team-category]/[team-name]”.
So…is there a way to use either Bidirectional Relationship code or just use the Relationship field on the “Team” CPT to prepend “/teams/darkside/12-darkside/” before the “Player” CPT’s permalink? The end result would look like “/teams/darkside/12-darkside/[player-name]”.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2022 Advanced Custom Fields.