Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
add_action('admin_menu', 'my_users_menu');
function my_users_menu() {
add_users_page( $page_title, $menu_title, $capability, $menu_slug, $function);
$capability: そのページを見るために必要な権限。 参照
$menu_slug: wp-admin/users.php?page={$menu_slug} のように使われる。
$function: 画面の内容を出力する関数の名前。
add_users_page('My Plugin Users', 'My Plugin', 'edit_users', 'my-unique-identifier', 'my_plugin_function');
function my_plugin_function() {
echo "画面の内容";
function set_super_user() {
add_user_meta(1, 'super_user', true, true);
add_action('init', 'set_super_user');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment