To solve this problem i’ve used this in my js file:
var location = String(window.location);
//only runs in post.php and post-new.php
if(location.search('post.php') != -1 || location.search('post-new.php') != -1 )
{
}
But it’s does not seem like i solid solution. Are there any other way?
You can use this in your
functions.php
: