boonebgorges / buddypress-docs

GNU General Public License v3.0
106 stars 44 forks source link

Permalink structure #648

Open imskriaz opened 5 years ago

imskriaz commented 5 years ago

Please help to get the permalink structure with post id instead of post slug, I am not getting correct file to edit.

boonebgorges commented 5 years ago

Can you say more about your problem? If you're getting the wrong Doc at a URL, then a post ID permalink structure is a workaround. It would be better to fix the underlying issue.

imskriaz commented 5 years ago

Hi Boonegorges, we are trying to make permalink for docs with post id instead of docs cpt's slug, but unable to to Figure out how it can be done, for the same seeking your help. Post Id in permalink is convenient for us then post slug. Please help.

boonebgorges commented 5 years ago

It will not be easy to make this work, because Docs has a custom routing system. You might be able to customize some filters and make the system mostly work. Here are the first places to look:

https://github.com/boonebgorges/buddypress-docs/blob/e9adfc0f453b49411dae5c5dbe8d5feecfc6d999/includes/component.php#L91 https://github.com/boonebgorges/buddypress-docs/blob/e9adfc0f453b49411dae5c5dbe8d5feecfc6d999/bp-docs.php#L543 https://github.com/boonebgorges/buddypress-docs/blob/e9adfc0f453b49411dae5c5dbe8d5feecfc6d999/includes/templatetags-edit.php#L67

You will have to use some creativity to override the post_name behavior, but this should be a good starting point.

If you're doing this in order to fix a bug in buddypress-docs, I urge you to share the details of the bug, rather than working around the issue with permalinks.