• I would like to change the permalinks for all custom posts of a certain type in a program. I have the hook I need, the function works, I see how to get the permalink, but I don’t see how to change the permalink in a program.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    I’m sorry no one responded to your question. You’ve probably figured this out by now, but for anyone else finding this via search, the hook is ‘the_permalink’ filter. It’s changed by returning an altered permalink from the added callback function.

    One should be able to extract the custom post type from the permalink passed to your filter callback function, use that to decide if the link should be changed.

Viewing 1 replies (of 1 total)

The topic ‘Changing permalink in code’ is closed to new replies.