Tagged: custom post type
August 19, 2021 at 4:32 pm #11301
Thanks for the plugin, we use it lots and it’s really useful!
I’ve encountered a weird bug, where I create a custom post type using the filter
piklist_post_types, permalinks of pages of that custom post type get overwritten every time you save the page. Using the exact same array and creating the post type using WordPress’ own register_post_type method fixes the issue. It doesn’t block me, as I will use the native method, but I wanted to let you know anyway.
Attachments:You must be logged in to view attached files.
August 20, 2021 at 9:19 am #11307
August 23, 2021 at 2:35 pm #11309
No, it does not create a new page or anything, it just replaces the permalink of the post you are working on. Let’s say you have a custom post type ‘services’ and a page with the title: ‘Rent a vehicle’, and your permalink is ‘example.com/services/rentals’, after saving the page, it will replace the permalink with ‘example.com/services/rent-a-vehicle’, and you will need to edit the permalink back to ‘example.com/services/rentals’.
Hope this helps!
August 23, 2021 at 3:23 pm #11310
Done some digging, and the only difference I am seeing between piklist and regular CPTs is that the post_arr in wp_insert_post() comes with an empty post_name, so it creates a new one by sanitizing the title. If I had more time I’d investigate further but unfortunately I don’t.
- You must be logged in to reply to this topic.