[wp-hackers] Best way to detect post type in admin

Andrew Nacin wp at andrewnacin.com
Thu Jul 15 06:41:56 UTC 2010


On Wed, Jul 14, 2010 at 11:55 PM, Lox <lox.dev at knc.nc> wrote:

> In a plug-in I want to enqueue scripts only on a specific post type
> new/edit form page.
>

$typenow will contain the post type. See the $current_screen object for more
context. (There's also $taxnow, $pagenow, and others. $current_screen
definitely the best thing to inspect.)


More information about the wp-hackers mailing list