bobbingwide / ebps-meetings

EBPS Meetings
0 stars 0 forks source link

Permalinks to events should include `/event/` rather than `/tribe_events/` #3

Closed bobbingwide closed 2 years ago

bobbingwide commented 2 years ago

In v0.1.0 of the ebps-meetings plugin the permalinks generated for the events are of the form https://home-url/tribe_events/post-name eg https://s.b/ebps/tribe_events/n-autumn-zoom-meeting/

they should be https://home-url/event/post-name

It appears that the rewrite attribute passed on the registration is being ignored.

bobbingwide commented 2 years ago

Investigate why it's not being used by get_permalink()

In an earlier attempt to implement the tribe_events Custom Post Type I'd used oik-types to register it. This did not include the rewrite array, so the rewrite slug was tribe_events. The post type was being registered before the shortcode expansion so no attempt to reregister it was being performed. Solution. Delete the CPT registered by oik-types.

Implement an efficient solution to the problem

Once the oik-types registered post type was deleted the problem resolved itself. While investigating the problem I did write a very simple wrapper to get_permalink(). I haven't removed this logic.