custom post types – How to add filter to post_name just for a CPT


I was seeing this post on how to add a filter that allows adding dots to post_name.

I made a change to use only dots.

I want to make it work only for one type of CPT.

But I don’t know how to check this in the admin.

I’m trying to add_action (‘admin_init’, ‘…’);

But when it passes through admin-ajax.php, it does not recognize the conditions to check the type of CPT.

See my code.