{"id":1866,"date":"2016-02-25T07:28:44","date_gmt":"2016-02-24T22:28:44","guid":{"rendered":"http:\/\/aws2000.net\/?p=1866"},"modified":"2017-01-28T15:05:04","modified_gmt":"2017-01-28T06:05:04","slug":"wordpress%e3%81%a7%e3%81%99%e3%81%b9%e3%81%a6%e3%81%ae%e7%ae%a1%e7%90%86%e8%80%85%e3%82%92%e5%a4%b1%e3%81%a3%e3%81%a6%e3%81%97%e3%81%be%e3%81%a3%e3%81%9f%e6%99%82%e3%81%ae%e5%be%a9%e6%b4%bb%e6%96%b9","status":"publish","type":"post","link":"https:\/\/aws2000.net\/?p=1866","title":{"rendered":"WordPress\u3067\u3059\u3079\u3066\u306e\u7ba1\u7406\u8005\u3092\u5931\u3063\u3066\u3057\u307e\u3063\u305f\u6642\u306e\u5fa9\u6d3b\u65b9\u6cd5\u306a\u3069"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1871\" src=\"\/\/aws2000.net\/wp-content\/uploads\/2016\/02\/16916285453_9d7a77b5bd_z-e1456346746225.jpg\" alt=\"surprising\" width=\"500\" height=\"363\" srcset=\"https:\/\/aws2000.net\/wp-content\/uploads\/2016\/02\/16916285453_9d7a77b5bd_z-e1456346746225.jpg 640w, https:\/\/aws2000.net\/wp-content\/uploads\/2016\/02\/16916285453_9d7a77b5bd_z-e1456346746225-300x218.jpg 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>\u5148\u307b\u3069\u3001Wordpress\u3067\u3042\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u7528\u3057\u3066\u3001\u7279\u5b9a\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u7279\u5b9a\u306e\u6a29\u9650\u3092\u4e0e\u3048\u308b\u3088\u3046\u306a\u8a2d\u5b9a\u3092\u3057\u3088\u3046\u3068\u3057\u305f\u3089\u3001\u7ba1\u7406\u8005\u3067\u3042\u308b\u81ea\u5206\u81ea\u8eab\u306e\u6a29\u9650\u3092\u3059\u3079\u3066\u5931\u3063\u3066\u3057\u307e\u3046\u3088\u3046\u306a\u8aa4\u64cd\u4f5c\u3092\u3057\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u304a\u5ba2\u3055\u307e\u306e\u30b5\u30a4\u30c8\u3060\u3063\u305f\u306e\u3067\u3001\u304b\u306a\u308a\u3001\u9752\u3056\u3081\u3064\u3064\u3082\u3001\u7d76\u5bfe\u306b\u4f55\u3068\u304b\u306a\u308b\u306f\u305a\u3060\u3068\u3001\u3042\u3061\u3053\u3061\u3092\u8abf\u3079\u307e\u3057\u305f\u3002<\/p>\n<p>\u7d50\u679c\u3068\u3057\u3066\u306f\u3001functions.php \u306b\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3001\u5f37\u5236\u7684\u306b\u6a29\u9650\u3092\u5fa9\u6d3b\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u81ea\u5206\u306e\u9632\u5099\u9332\u3082\u517c\u306d\u3066\u3001\u3053\u3053\u306b\u6295\u7a3f\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>WordPress\u3067\u3001\u3046\u3063\u304b\u308a\u7ba1\u7406\u8005\u6a29\u9650\u306e\u30e6\u30fc\u30b6\u30fc\u3092\u3059\u3079\u3066\u524a\u9664\u3057\u3066\u3057\u307e\u3046\u3068\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u3001\u30c6\u30fc\u30de\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u7ba1\u7406\u306a\u3069\u7ba1\u7406\u8005\u6a29\u9650\u3067\u3057\u304b\u3067\u304d\u306a\u3044\u3053\u3068\u304c\u3067\u304d\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3093\u306a\u3068\u304d\u306f\u3001functions.php \u306b\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u8a18\u3057\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u3092\u5f37\u5236\u7684\u306b\u7ba1\u7406\u8005\u306b\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-php\">function set_user_role() {\r\n  $user = new WP_User( 1 );\r\n  $user->set_role( 'administrator');\r\n}\r\nadd_action( 'init', 'set_user_role' );\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>WP_User( 1 )\u306e\u4e2d\u306e\u30011 \u3068\u3044\u3046\u306e\u306f\u3001\u6700\u521d\u306b\u8ffd\u52a0\u3055\u308c\u305f\u30e6\u30fc\u30b6\u30fc\u3067\u3059\u3002<\/p>\n<p>2\u756a\u3081\u306b\u8ffd\u52a0\u3055\u308c\u305f\u30e6\u30fc\u30b6\u30fc\u3092\u7ba1\u7406\u8005\u306b\u5909\u66f4\u3059\u308b\u5834\u5408\u306b\u306f\u30012 \u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u307e\u305f\u3001\u7de8\u96c6\u8005\u306b\u3001\u6a29\u9650\u3092\u8ffd\u52a0\u3057\u305f\u3044\u3068\u3044\u3046\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3067\u3001\u500b\u5225\u306b\u6a29\u9650\u3092\u4ed8\u52a0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3082\u3001functions.php\u306b\u8ffd\u8a18\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-php\">function change_caps(){\r\n  $role = get_role( 'editor' ); \/\/ \u7de8\u96c6\u8005\r\n  $role->add_cap('activate_plugins' );\r\n  $role->add_cap('delete_plugins' );\r\n  $role->add_cap('edit_dashboard' );\r\n  $role->add_cap('edit_files' );\r\n  $role->add_cap('edit_theme_options' );\r\n  $role->add_cap('export' );\r\n  $role->add_cap('import' );\r\n  $role->add_cap('list_users' );\r\n  $role->add_cap('manage_options' );\r\n  $role->add_cap('promote_users' );\r\n  $role->add_cap('remove_users' );\r\n  $role->add_cap('switch_themes' );\r\n  $role->add_cap('update_core' );\r\n  $role->add_cap('update_plugins' );\r\n  $role->add_cap('update_themes' );\r\n  $role->add_cap('install_plugins' );\r\n  $role->add_cap('install_themes' );\r\n  $role->add_cap('delete_themes' );\r\n  $role->add_cap('edit_plugins' );\r\n  $role->add_cap('edit_themes' );\r\n  $role->add_cap('edit_users' );\r\n  $role->add_cap('create_users' );\r\n  $role->add_cap('delete_users' );\r\n}\r\nadd_action( 'admin_init', 'change_caps' );\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u4e0a\u306e\u4f8b\u3067\u306f\u3001\u7de8\u96c6\u8005\uff08editor\uff09\u3067\u3057\u305f\u304c\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u7ba1\u7406\u8005 : administrator<\/li>\n<li>\u7de8\u96c6\u8005 : editor<\/li>\n<li>\u6295\u7a3f\u8005 : author<\/li>\n<li>\u5bc4\u7a3f\u8005 : contributor<\/li>\n<li>\u8cfc\u8aad\u8005 : subscriber<\/li>\n<\/ul>\n<p>\u307e\u305f\u3001\u6a29\u9650\u306b\u3064\u3044\u3066\u306e\u8a73\u7d30\u306f\u3001\u300e<a href=\"http:\/\/wpdocs.osdn.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\" target=\"_blank\">\u30e6\u30fc\u30b6\u30fc\u306e\u7a2e\u985e\u3068\u6a29\u9650<\/a>\u300f\u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u51e6\u7406\u3068\u3057\u3066\u306f\u3001add_cap \u3067\u6a29\u9650\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u304c\u3001\u9006\u306b\u6a29\u9650\u3092\u524a\u9664\u3059\u308b\u5834\u5408\u306b\u306f\u3001remove_cap \u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p><strong>$role-&gt;remove_cap(&#8216;delete_users&#8217; );<\/strong><\/p>\n<p>\u3068\u3044\u3046\u611f\u3058\u3067\u66f8\u304d\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u6700\u5f8c\u306b\u30fb\u30fb\u30fb\u30fb<\/p>\n<p>\u3053\u308c\u3089\u306e\u30b3\u30fc\u30c9\u306f\u3001\u4e00\u5ea6\u5b9f\u884c\u3057\u305f\u3042\u3068\u306f\u3001\u518d\u5ea6\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u306e\u306a\u3044\u3082\u306e\u3067\u3059\u306e\u3067\u3001\u524a\u9664\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u524a\u9664\u3057\u306a\u3044\u3067\u6b8b\u3057\u3066\u3057\u307e\u3046\u3068\u3001Wordpress\u304c\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u8d77\u3053\u3059\u305f\u3073\u306b\u5b9f\u884c\u3055\u308c\u3001\u7121\u99c4\u306a\u51e6\u7406\u3067\u305d\u306e\u5206\u52d5\u304d\u304c\u9045\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u4e00\u5ea6\u5b9f\u884c\u3057\u305f\u3042\u3068\u306b\u306f\u3001\u5fc5\u305a\u524a\u9664\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; \u5148\u307b\u3069\u3001Wordpress\u3067\u3042\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u7528\u3057\u3066\u3001\u7279\u5b9a\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u7279\u5b9a\u306e\u6a29\u9650\u3092\u4e0e\u3048\u308b\u3088\u3046\u306a\u8a2d\u5b9a\u3092\u3057\u3088\u3046\u3068\u3057\u305f\u3089\u3001\u7ba1\u7406\u8005\u3067\u3042\u308b\u81ea\u5206\u81ea\u8eab\u306e\u6a29\u9650\u3092\u3059\u3079\u3066\u5931\u3063\u3066\u3057\u307e\u3046\u3088\u3046\u306a\u8aa4\u64cd\u4f5c\u3092\u3057\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002 \u304a\u5ba2\u3055\u307e\u306e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1871,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":{"0":"post-1866","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-wordpress"},"_links":{"self":[{"href":"https:\/\/aws2000.net\/index.php?rest_route=\/wp\/v2\/posts\/1866","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aws2000.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aws2000.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aws2000.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aws2000.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1866"}],"version-history":[{"count":13,"href":"https:\/\/aws2000.net\/index.php?rest_route=\/wp\/v2\/posts\/1866\/revisions"}],"predecessor-version":[{"id":3148,"href":"https:\/\/aws2000.net\/index.php?rest_route=\/wp\/v2\/posts\/1866\/revisions\/3148"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/aws2000.net\/index.php?rest_route=\/wp\/v2\/media\/1871"}],"wp:attachment":[{"href":"https:\/\/aws2000.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1866"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aws2000.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1866"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aws2000.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1866"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}