admin管理员组文章数量:1277875
I currently doing a WordPress Plugin and I am successful when I try to put CSS or JavaScript on the frontend but I don't know on where I fail when I trying to do the same on backend side, this is my code:
function my_function($hook) {
global $post;
if($hook == 'post-new.php' || $hook == 'post.php') {
if($post->post_type == 'post_type_name') {
wp_enqueue_style('adminCSS', plugins_url('../assets/css/admin.css', __FILE__) );
}
}
}
add_action( 'admin_enqueue_scrips', 'my_function');
As you see on my code I only want the CSS file on the plugin's post type side, that's why I do all the stuff with the $hook and the post type. Can you tell me what error I made there?
本文标签: hooksFail on adminenqueuescripts when I try it to upload a CSS file to my WordPress Plugin
版权声明:本文标题:hooks - Fail on admin_enqueue_scripts when I try it to upload a CSS file to my WordPress Plugin 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741254402a2366392.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论