WordPress 3.8自定义文章类型图标

5

在更新到WordPress 3.8之后,我的自定义文章类型图标不再起作用。

我尝试更改CSS,但是如果它以前有效,为什么现在不行呢?

CSS代码如下:

#adminmenu #menu-posts-cpt-stores:hover div.wp-menu-image, #adminmenu #menu-posts-cpt-stores.wp-has-current-submenu div.wp-menu-image {
background: transparent url('http://localhost:8888/dev.com/wp-content/themes/dev/images/icons/cpt-icon-16x16-hover.png') no-repeat scroll 7px 5px;
}
2个回答

7
WordPress现在使用dashicons字体作为自定义文章类型图标,因此现在您不需要使用背景属性来显示我们的CPT自定义图标。您可以使用内容属性进行操作...
甚至您可以添加menu_icon参数参数并给它一个类名..例如:
'menu_icon' => 'dashicons-format-gallery',

谢谢 - 搞清楚了 - 我想这让它更简单了。 - jolen

3

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接