我有此代码来创建自定义帖子类型,但当我显示此帖子类型的图标时,它会打印主题URL:
\'menu_icon\' => \'\'.bloginfo(\'stylesheet_directory\').\'/images/home-20.png\',
我需要主题URL,但不打印
wp-admin
.
function units() {
register_post_type( \'units\',
array(
\'labels\' => array (
\'name\' => \'الوحدات\',
\'singular_name\' => \'الوحدات\',
\'add_new\' => \'اضافة جديد\',
\'add_new_item\' => \'اضافة جديد\',
\'edit\' => \'تعديل\',
\'edit_item\' => \'تعديل\',
\'new_item\' => \'اضافة جديد\',
),
\'_builtin\' => false,
\'public\' => true,
\'show_ui\' => true,
\'show_in_nav_menus\' => true,
\'menu_position\' => 5 ,
\'hierarchical\' => false,
\'has_archive\' => true,
\'capability_type\' => \'page\',
\'menu_icon\' => \'\'.bloginfo(\'stylesheet_directory\').\'/images/home-20.png\',
\'rewrite\' => array(
\'slug\' => \'units\',
\'with_front\' => false,
\'pages\' => true
),
\'supports\' => array(
\'title\',
\'thumbnail\',
\'editor\',
)
)
);
}
add_action(\'init\', \'units\');