Skip to content

Instantly share code, notes, and snippets.

@shield-9 shield-9/functions.2.php Secret
Last active Aug 29, 2015

Embed
What would you like to do?
#WordPress-ja-forum-133773
<?php
add_action('admin_menu', 'my_users_menu');
function my_users_menu() {
/*
add_users_page( $page_title, $menu_title, $capability, $menu_slug, $function);
$capability: そのページを見るために必要な権限。
http://wpdocs.sourceforge.jp/%E3%83%A6%E3%83%BC%E3%82%B6%E3%83%BC%E3%81%AE%E7%A8%AE%E9%A1%9E%E3%81%A8%E6%A8%A9%E9%99%90 参照
$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
You can’t perform that action at this time.