为了解决这个问题,我在js文件中使用了这个:
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 )
{
}
但它似乎不是固溶体。还有别的办法吗?为了解决这个问题,我在js文件中使用了这个:
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 )
{
}
但它似乎不是固溶体。还有别的办法吗?您可以在functions.php
:
function add_admin_scripts( $hook ) {
if ( $hook == \'post-new.php\' ) {
wp_enqueue_script( \'myscript\', get_bloginfo(\'template_directory\').\'/js/myscript.js\' );
}
}
add_action(\'admin_enqueue_scripts\',\'add_admin_scripts\',10,1);
出于某种原因,当我转到我的一个客户端WordPress安装,并安装一个我制作的插件,该插件有自定义的TinyMCE按钮,当他们单击其中一个按钮时,弹出窗口会出现,但没有文本。在我单击按钮之前,Google Chrome的JavaScript控制台中有以下内容:Failed to load resource: the server responded with a status of 404 (Not Found) - Array - http://mywebsiteurl.com/wp-admin/Arr