我有一些php,其中包含一些链接,我想对其进行样式设置并变成按钮。
add_action('admin_menu', 'wpso_custom_links_admin_menu');
function wpso_custom_links_admin_menu() {
global $submenu;
$submenu['index.php'][] = array( 'Link One', 'read', 'https://www.example.com/' );
$submenu['index.php'][] = array( 'Link Two', 'read', 'https://asdf.com/' );
}
问题是我不确定如何在此处或在何处添加类以使用CSS进行样式设置。
答案 0 :(得分:1)
这应该做:
add_action('admin_menu', 'wpso_custom_links_admin_menu');
function wpso_custom_links_admin_menu() {
global $submenu;
$submenu['index.php'][] = array( 'Link One', 'read', 'https://www.example.com/', '', 'my-class');
$submenu['index.php'][] = array( 'Link Two', 'read', 'https://asdf.com/', '', 'my-class');
}