How can I generate a pretty permalink correctly for a post knowing the permalink structure?
My posts where processed with the FeedWordPress plugin with the "Link" setting set to "Permalinks point to: The copy on the original website".
So for all the posts in the admin area when editing a post the "Permalink" field under the post title shows an original, external site's URL, which is stored in the "syndication_permalink" meta data.
What I would like to do is to generate a pretty permalink for all such posts that would point to a local host (i.e. the post will have a permalink of type "http://mysite.com/" rather than have an external link to a source), so that I can update the permalinks in DB.
I can get the permalink structure using get_option('permalink_structure')
. Is there a WP function that I can use to get a pretty permalink generated correctly for a post by its ID?
Hope that makes sense.
Thanks, Dasha