ppo
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: sanitize_title() outside WP? (to get post URL)Forum: Developing with WordPress
In reply to: sanitize_title() outside WP? (to get post URL)Thank you @shayde22 but that’s a short-sighted approach.
The objective is not to do “something similar” but to do “always exactly the same thing”; if not, the URL is wrong and therefore not working. That’s extremely important, otherwise everything else was useless.
(Like you do a very long trip to paradise… but you took the wrong key for the entrance gate. You may not take just any key.)When you dig into the
sanitize_title()code, you see:remove_accents()andapply_filters()that “Calls the callback functions that have been added to a filter hook.” What are these exactly doing? It’s a hook, related to plugins. Can they step in and change the value? For example, can an SEO-related plugin decide to remove the unnecessary “the” or “of”? How do they handle's? Etc.I don’t find there the code where the conversion to “-” is done. So it’s hidden in one of the filters. What else is hidden in there?
Forum: Developing with WordPress
In reply to: sanitize_title() outside WP? (to get post URL)Thank you for your answer.
I think there are some misunderstandings. I don’t want to create/insert new posts in WP. I generate XML files that I send to the WP guys who import them. They’ve already setup the permalink structure in WP and everything is fine there. I just need to be able to generate the exact same permalink on my own.I didn’t mention that but currently the XMLs are generated BEFORE the data are actually in WP. So I can’t even read the WP DB.
I could 🫤🙄 generate the SiteX XML after the data have been imported in WP… but is the final/definitive URL of the post stored in the DB? Do you know where it’s exactly stored?