Skip to content

Instantly share code, notes, and snippets.

@terrylinooo
Created October 11, 2023 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save terrylinooo/8a430294f4f526d0977476987baf88d8 to your computer and use it in GitHub Desktop.
Save terrylinooo/8a430294f4f526d0977476987baf88d8 to your computer and use it in GitHub Desktop.
airyseo_custom_menu_page
/**
* 鐵人賽頁面設定選單:最上層選單
*/
function airyseo_custom_menu_page() {
add_menu_page(
'示範頁面標題',
'示範選單文字',
'manage_options',
'airyseo_custom_menu_page',
'airyseo_custom_menu_page_content'
);
add_submenu_page(
'airyseo_custom_menu_page',
'示範子選單頁面標題',
'示範子選單文字',
'manage_options',
'airyseo_custom_submenu_page',
'airyseo_custom_submenu_page_content'
);
}
/**
* 鐵人賽示範頁:設定頁的內容
*/
function airyseo_custom_menu_page_content() {
echo '<h1>這是示範設定頁的標題</h1>';
echo '<p>這是示範設定頁的內容</p>';
}
/**
* 鐵人賽示範頁:設定子頁的內容
*/
function airyseo_custom_submenu_page_content() {
echo '<h1>這是示範設定子選單頁的標題</h1>';
echo '<p>這是示範設定子選單頁的內容</p>';
}
add_action( 'admin_menu', 'airyseo_custom_menu_page' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment