Supposed I have these urls: http://my-domain.tld/projects-listing-cpt
and http://my-domain.tld/musics-listing-cpt
.
The custom post types was setted this way:
Projects:
Text Domain: projets
$args = [
...
'rewrite' => array( 'slug' => 'projects-listing-cpt' ),
'capability_type' => 'project'
]
Musics:
Text Domain: musics
$args = [
...
'rewrite' => array( 'slug' => 'musics-listing-cpt' ),
'capability_type' => 'music'
]
How can I check the rewrite slug of current post type listing page to get something like this:
if( funct_to_get_this_slug('projects-listing-cpt') == 'projects-listing-cpt' ) //show specific things for this custom post type