OpenGIS / Waymark

Waymark adds powerful mapping features to WordPress that are easy to use. Create beautiful, interactive Maps that you can customise to suit your needs.
https://www.waymark.dev
GNU General Public License v2.0
20 stars 6 forks source link

Set 'with_front' to false #5

Closed huubl closed 2 years ago

morehawes commented 2 years ago

Hi @huubl,

Thank you for your contribution. Could you please describe the affects of your change, as I am not familiar with this rewrite setting.

Changing the permalink structure could have a knock-on affect to existing users, so I want to understand the pros and cons.

Cheers,

Joe

huubl commented 2 years ago

Hi,

When using this custom permalink structure: image

The Waymark map url is set as: https://domain.com/news/map/my-map

Setting the 'with_front' to false prevents the prepend gets added to the url. So it will be:

https://domain.com/map/my-map

Info: https://developer.wordpress.org/reference/functions/register_post_type/ "(bool) Whether the permastruct should be prepended with WP_Rewrite::$front. Default true."

morehawes commented 2 years ago

Apologies for the delay, I didn't get time to look at this properly until now... and I am still figuring out GitHub :0)

I agree that this is a good addition, thanks! I was concerned about breaking links for existing users by changing the permalink structure, but Waymark rebuilds the permalinks automatically when switching versions so I think that's good.

I have merged this into the development branch.

Cheers,

Joe