How to add filter to post_name just for a CPT

Question

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.

--------------------------------------------------

>>> Share a link to this question, just copy and paste the code bellow on your web page <<<

<a href="https://www.wptricks.com/question/how-to-add-filter-to-post_name-just-for-a-cpt/">

How to add filter to post_name just for a CPT</a>
0
, , Marcus Vinicius 1 month 0 Answers 54 views 0

Leave an answer