<?php\n\/\/ \u30e1\u30cb\u30e5\u30fc\u306b\u4f1a\u793e\u60c5\u5831\u7ba1\u7406\u3092\u8ffd\u52a0\nadd_action('admin_menu', 'company_settings_menu');\nfunction company_settings_menu() {\n \/\/ \u7b2c1\u5f15\u6570: \u30bf\u30a4\u30c8\u30eb\n \/\/ \u7b2c2\u5f15\u6570: \u8868\u793a\u540d\n \/\/ \u7b2c3\u5f15\u6570: \u7ba1\u7406\u6a29\u9650(\u666e\u901a\u306fmanage_options\u3067\u3044\u3044\u3068\u601d\u3044\u307e\u3059)\n \/\/ \u7b2c4\u5f15\u6570: \u30da\u30fc\u30b8\u306eid\n \/\/ \u7b2c5\u5f15\u6570: \u8aad\u307f\u3060\u3059View\u3092\u8a18\u8ff0\u3059\u308b\u95a2\u6570\u540d\n add_options_page('\u4f1a\u793e\u60c5\u5831\u7ba1\u7406', '\u4f1a\u793e\u60c5\u5831\u7ba1\u7406', 'manage_options', 'company_settings', 'company_settings_page');\n}\n\/\/ \u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u4f5c\u6210\nadd_action( 'admin_init', 'register_company_settings' );\nfunction register_company_settings() {\n $my_options = ['name', 'tel', 'email', 'postal_code', 'address', 'business_time'];\n foreach($my_options as $my_option){\n register_setting( 'company_settings', 'company_'.$my_option );\n }\n}\n\/\/ View\u306e\u8a2d\u5b9a\nfunction company_settings_page() {\n include 'views\/company_setting.php';\n}<\/code><\/pre><\/div>\n\n\n\n<\/span>View\u306e\u4f5c\u6210<\/span><\/h3>\n\n\n\nadd_options_page<\/code>\u306e\u7b2c\uff15\u5f15\u6570\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308a\u3001View\u3092\u8a18\u8ff0\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<div class="wrap">\n <h2>\u4f1a\u793e\u60c5\u5831\u8a2d\u5b9a<\/h2>\n \/\/ action\u306f\u5fc5\u305aoption.php\u306b\u3059\u308b\n <form method="post" action="options.php">\n \/\/ \u3053\u306e\uff12\u884c\u3067\u3069\u306e\u8a2d\u5b9a\u304b\u3092\u6307\u5b9a\u3059\u308b\n <?php settings_fields( 'company_settings' ); ?>\n <?php do_settings_sections( 'company_settings' ); ?>\n \/\/ \u3053\u3053\u304b\u3089\u30b7\u30b3\u30b7\u30b3\u3068\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u4f5c\u308b\u3002\n \/\/ table\u306bform-table\u3068\u3044\u3046\u30af\u30e9\u30b9\u3092\u3064\u3051\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30c6\u30fc\u30d6\u30eb\u69cb\u9020\u306b\u3059\u308b\u3068\u3001\n \/\/ \u4ed6\u306e\u8a2d\u5b9a\u753b\u9762\u3068\u540c\u69d8\u306e\u8868\u793a\u306b\u306a\u308b\n <table class="form-table">\n <tbody>\n <tr>\n <th scope="row">\n <label for="company_name">\u4f1a\u793e\u540d<\/label>\n <\/th>\n <td><input type="text" id="company_name" class="regular-text" name="company_name" value="<?= get_option('company_name'); ?>"><\/td>\n <\/tr>\n <tr>\n <th scope="row">\n <label for="company_tel">\u96fb\u8a71\u756a\u53f7<\/label>\n <\/th>\n <td><input type="text" id="company_tel" class="regular-text" name="company_tel" value="<?= get_option('company_tel'); ?>"><\/td>\n <\/tr>\n <tr>\n <th scope="row">\n <label for="company_tel">\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9<\/label>\n <\/th>\n <td><input type="text" id="company_email" class="regular-text" name="company_email" value="<?= get_option('company_email'); ?>"><\/td>\n <\/tr>\n <tr>\n <th scope="row">\n <label for="company_postal_code">\u4f1a\u793e\u6240\u5728\u5730\u306e\u90f5\u4fbf\u756a\u53f7<\/label>\n <\/th>\n <td><input type="text" id="company_postal_code" class="regular-text" name="company_postal_code" value="<?= get_option('company_postal_code'); ?>"><\/td>\n <\/tr>\n <tr>\n <th scope="row">\n <label for="company_address">\u4f1a\u793e\u6240\u5728\u5730<\/label>\n <\/th>\n <td><input type="text" id="company_address" class="regular-text" name="company_address" value="<?= get_option('company_address'); ?>"><\/td>\n <\/tr>\n <tr>\n <th scope="row">\n <label for="company_business_time">\u55b6\u696d\u6642\u9593<\/label>\n <\/th>\n <td><input type="text" id="company_business_time" class="regular-text" name="company_business_time" value="<?= get_option('company_business_time'); ?>"><\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <?php submit_button(); ?>\n <\/form>\n<\/div><\/code><\/pre><\/div>\n\n\n\n\u3053\u308c\u3067\u304a\u3057\u307e\u3044\u3067\u3059\u3002<\/p>\n\n\n\n
<\/span>functions.php\u5185\u3067\u8aad\u307f\u8fbc\u3080<\/span><\/h2>\n\n\n\n\u3053\u3053\u307e\u3067\u6765\u305f\u3089\u3001\u307b\u307c\u5b8c\u6210\u3067\u3059\u3002
\n\u3042\u3068\u306ffunctions.php<\/code>\u5185\u3067include 'company_setting.php'<\/code>\u3068\u66f8\u3044\u3066\u3084\u308b\u3060\u3051\u3067\u3001\u7ba1\u7406\u753b\u9762\u306e\u8a2d\u5b9a\u306e\u9805\u76ee\u306e\u4e2d\u306b\u300c\u4f1a\u793e\u60c5\u5831\u8a2d\u5b9a\u300d\u304c\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<\/span>\u307e\u3068\u3081<\/span><\/h2>\n\n\n\n\u30da\u30fc\u30b8\u5168\u4f53\u3067\u4f7f\u3046\u57fa\u672c\u60c5\u5831\u307f\u305f\u3044\u306a\u3082\u306e\u306f\u8a2d\u5b9a\u3092\u65b0\u3057\u304f\u4f5c\u3063\u3066\u7ba1\u7406\u3057\u307e\u3057\u3087\u3046\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"
\u7d4c\u7def WordPress\u3092\u4f7f\u3063\u3066Web\u30b5\u30a4\u30c8\u306a\u3069\u3092\u69cb\u7bc9\u3057\u3066\u3044\u308b\u3068\u3001\u8a2d\u5b9a\u3067\u7ba1\u7406\u3059\u3079\u304d\u90e8\u5206\u304c\u51fa\u3066\u304f\u308b\u3068\u601d\u3044\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001\u4f01\u696d\u306eWeb\u30da\u30fc\u30b8\u3068\u304b\u3060\u3068\u3001\u6240\u5728\u5730\u3084\u96fb\u8a71\u756a\u53f7\u306a\u3069\u306f\u30a2\u30af\u30bb\u30b9\u306e\u30da\u30fc\u30b8\u306b\u3042\u3063\u305f\u308a\u3001footer\u306b\u3042\u3063\u305f\u308a\u3002 […]<\/p>\n","protected":false},"author":1,"featured_media":4304,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[32,5],"tags":[39,33],"class_list":["post-4292","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","category-program","tag-php","tag-wordpress"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/posts\/4292"}],"collection":[{"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/comments?post=4292"}],"version-history":[{"count":3,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/posts\/4292\/revisions"}],"predecessor-version":[{"id":208574,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/posts\/4292\/revisions\/208574"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/"}],"wp:attachment":[{"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/media?parent=4292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/categories?post=4292"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/tags?post=4292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}