Loading External Scripts in Admin but ONLY for a Specific Post Type?

Posted by Prem Tiwari | Updated on

We are hooking admin_init with the function load_my_script() to tests the global $pagenow for a match with the admin page edit.php, and the global $typenow to see if the post type is the one you want.

The rest are just details which you can read about here if you need to learn more:

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers