Wordpress permalink post_type

I am looking for a way to get post_type in permalink wordpress structure - especially considering the custom post_type defined by my own plugin.

Is there an easy way to do this, or do you know any decent docs on handling / redirecting the wordpress url (the code seems to be missing some rewriting part).

+3
source share
2 answers

It seems that if you use a permalink structure other than the default, then you will get a permalink / post_type / post_name structure.

So, if I registered post_type 'video', that would be http://yourdomain.com/video/post_name

, , , , ? id = 123 - . (, post_type query_var, .)

URL WP, , ... , .

+2

post_type ? , , , Wordpress.

% category% - , . , wordpress codex , - , - :

% category% - name ( slug field New/Edit ). URI. % % .

EDIT. , post/page, . , , wp-includes\rewrite.php( Wordpress). , mod-rewrite, , ,

+1

Source: https://habr.com/ru/post/1733548/


All Articles