I am loading scripts for a custom post type with a function like this :
global $post_type;
if( 'portfolio' == $post_type )
wp_enqueue_script( 'maps_scripts', get_bloginfo('template_directory') . '/scripts/maps.js');
This works fine when I am added a new post in that post type :
post-new.php?post_type=portfolio
but when I go to edit one with this link
post.php?post=541&action=edit
I lose the portfolio parameter and also those scripts. How can I fix?