{"id":1693,"date":"2016-08-28T17:10:36","date_gmt":"2016-08-28T08:10:36","guid":{"rendered":"http:\/\/www.uniqware.net\/?p=1693"},"modified":"2016-08-28T17:10:36","modified_gmt":"2016-08-28T08:10:36","slug":"woocommerce%e3%81%a7%e5%95%86%e5%93%81%e5%b1%9e%e6%80%a7%e3%82%92%e8%bf%bd%e5%8a%a0%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.uniqware.net\/it\/archives\/1693","title":{"rendered":"WooCommerce\u3067\u5546\u54c1\u5c5e\u6027\u3092\u8ffd\u52a0\u3059\u308b"},"content":{"rendered":"<p>WooCommerce\u306fWordPress\u30d9\u30fc\u30b9\u306e\u30cd\u30c3\u30c8\u901a\u8ca9\u30b5\u30a4\u30c8\u3092\u69cb\u7bc9\u3059\u308b\u306e\u306b\u4fbf\u5229\u306a\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u3059\u3002\u901a\u5e38\u306e\u7269\u8ca9\u3067\u306f\u30cd\u30c3\u30c8\u901a\u8ca9\u306b\u5fc5\u8981\u306a\u6a5f\u80fd\u306f\u4e00\u901a\u308a\u5099\u308f\u3063\u3066\u3044\u308b\u306e\u3067\u305d\u306e\u307e\u307e\u306e\u72b6\u614b\u3067\u904b\u7528\u3067\u304d\u308b\u3068\u601d\u3044\u307e\u3059\u3002\u4eca\u56de\u306f\u73fe\u5728\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089\u4f9d\u983c\u3055\u308c\u3066\u3044\u308b\u65c5\u884c\u30ac\u30a4\u30c9\u306b\u95a2\u3059\u308b\u30de\u30c3\u30c1\u30f3\u30b0\u7528\u9014\u3067\u4f7f\u3044\u307e\u3059\u3002\u6271\u3046\u5546\u54c1\u304c\u30ac\u30a4\u30c9\u30d7\u30e9\u30f3\u3067\u3042\u308b\u7279\u6b8a\u6027\u304b\u3089\u5546\u54c1\u5c5e\u6027\u3092\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u6027\u304c\u51fa\u3066\u304d\u307e\u3057\u305f\u3002\u4eca\u56de\u306f\u3001\u65c5\u884c\u30d7\u30e9\u30f3\u306e\u90fd\u5e02\u540d\u3092\u5546\u54c1\u5c5e\u6027\u3068\u3057\u3066\u8ffd\u52a0\u3057\u307e\u3057\u305f\u306e\u3067\u305d\u306e\u624b\u9806\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<!--more--><\/p>\n\n<p>\u5546\u54c1\u5c5e\u6027\u306b\u95a2\u9023\u3059\u308b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f \/wp-content\/plugins\/woocommerce\/includes\/admin\/meta-boxes\/class-wc-meta-box-product-data.php \u306b\u3042\u308a\u3001\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u30b3\u30fc\u30c9\u3092\uff12\u30f6\u6240\u8ffd\u52a0\u3057\u307e\u3059\uff08\u5143\u30d5\u30a1\u30a4\u30eb\u306f\u4fdd\u5b58\u3057\u3066\u4e0b\u3055\u3044\uff09\u3002\u307e\u305a\u3001\uff11\u3064\u76ee\u306fpublic static function output( $post )\u95a2\u6570\u4e0b140\u884c\u76ee\u8fba\u308a\u306b\u3042\u308b\u4ee5\u4e0b\u306e\u5834\u6240\u3067\u3059\u3002\n<\/p>\n\n<pre class=\"brush: css; first-line: 140; html-script: true; title: class-wc-meta-box-product-data.php; notranslate\" title=\"class-wc-meta-box-product-data.php\">\n&lt;div id=&quot;general_product_data&quot; class=&quot;panel woocommerce_options_panel&quot;&gt;&lt;?php\n\n\techo '&lt;div class=&quot;options_group hide_if_grouped&quot;&gt;';\n\n\t\t\/\/ SKU\n\t\tif ( wc_product_sku_enabled() ) {\n\t\t\twoocommerce_wp_text_input( array( 'id' =&gt; '_sku', 'label' =&gt; '&lt;abbr title=&quot;'. __( 'Stock Keeping Unit', 'woocommerce' ) .'&quot;&gt;' . __( 'SKU', 'woocommerce' ) . '&lt;\/abbr&gt;', 'desc_tip' =&gt; 'true', 'description' =&gt; __( 'SKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased.', 'woocommerce' ) ) );\n\t\t} else {\n\t\t\techo '&lt;input type=&quot;hidden&quot; name=&quot;_sku&quot; value=&quot;' . esc_attr( get_post_meta( $thepostid, '_sku', true ) ) . '&quot; \/&gt;';\n\t\t}\n<\/pre>\n\n\u3053\u306eSKU\u306f\u5546\u54c1\u5c5e\u6027\u306e\u6700\u4e0a\u4f4d\u3067\u3001\u3053\u308c\u4ee5\u4e0b\u6570\u500b\u306e\u5c5e\u6027\u304c\u540c\u69d8\u306b\u8a18\u8ff0\u3055\u308c\u3066\u3044\u307e\u3059\u306e\u3067\u8ffd\u52a0\u3057\u305f\u3044\u4f4d\u7f6e\u3092\u6c7a\u3081\u307e\u3059\u3002\u4eca\u56de\u306f\u3053\u306eSKU\u306e\u66f4\u306b\u4e0a\u3001\u3064\u307e\u308a\u6700\u4e0a\u4f4d\u306b_product_city\u3068\u3044\u3046\u5c5e\u6027\u3092\u9078\u629e\u8981\u7d20\u3068\u3057\u3066\u8ffd\u52a0\u3057\u307e\u3059\u3002\u56e0\u307f\u306b\u9078\u629e\u80a2\u306fBuddyPress\u306e\u30b0\u30eb\u30fc\u30d7\u540d\u3067\u5024\u306f\u65e2\u306b$groups\u914d\u5217\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u307e\u3059\u3002\n\n<pre class=\"brush: css; first-line: 140; html-script: true; title: class-wc-meta-box-product-data.php; notranslate\" title=\"class-wc-meta-box-product-data.php\">\n&lt;div id=&quot;general_product_data&quot; class=&quot;panel woocommerce_options_panel&quot;&gt;&lt;?php\n\n\t$city_options = '';\n\tforeach ( $groups['groups'] as $group ) {\n\t\t$city_options[$group-&gt;slug] = $group-&gt;name;\n\t}\n\techo '&lt;div class=&quot;options_group hide_if_grouped&quot;&gt;';\n\t\t\twoocommerce_wp_select( array(\n\t\t\t\t'id'          =&gt; '_product_city',\n\t\t\t\t'label'       =&gt; __( 'Product City', 'woocommerce' ),\n\t\t\t\t'options'     =&gt; $city_options,\n\t\t\t\t'desc_tip'    =&gt; 'true',\n\t\t\t\t'description' =&gt; __( 'Choose the city where this product is relevant.', 'woocommerce' )\n\t\t\t) );\n\techo '&lt;\/div&gt;';\n<\/pre>\n\n\u6b21\u306b\u3053\u306e\u5c5e\u6027\u5024\u3092\u4fdd\u5b58\u30fb\u66f4\u65b0\u3059\u308b\u305f\u3081\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\u540c\u3058\u30d5\u30a1\u30a4\u30eb\u306epublic static function save( $post_id, $post ) \u95a2\u6570\u4e0b800\u884c\u76ee\u4ee5\u4e0b\u306b\u4fdd\u5b58\u30fb\u66f4\u65b0\u3059\u308b\u305f\u3081\u306e\u30b3\u30fc\u30c9\u304c\u7f85\u5217\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u9069\u5f53\u306a\u7b87\u6240\u306b\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\n\n<pre class=\"brush: css; first-line: 800; html-script: true; title: class-wc-meta-box-product-data.php; notranslate\" title=\"class-wc-meta-box-product-data.php\">\n\tif ( isset( $_POST['_product_city'] ) ) {\n\t\tupdate_post_meta( $post_id, '_product_city', wc_clean( $_POST['_product_city'] ) );\n\t}\n<\/pre>\n\n<strong>WordPress\u7ba1\u7406\u753b\u9762 > WooCommerce > \u5546\u54c1 > \u3067\u5546\u54c1\u4e00\u89a7\u304b\u3089\uff11\u3064\u3092\u9078\u3093\u3067\u5546\u54c1\u8a73\u7d30\u30da\u30fc\u30b8\u3092\u898b\u308b\u3068\u4e0b\u56f3\u306e\u3088\u3046\u306b Product City \u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u624b\u9806\u901a\u308a\u306b\u3084\u308c\u3070\u601d\u3044\u901a\u308a\u306b\u5546\u54c1\u5c5e\u6027\u3092\u5909\u66f4\u3067\u304d\u305d\u3046\u3067\u3059\u3002\n\n<a href=\"http:\/\/www.uniqware.net\/wp-content\/uploads\/wc_addmeta.jpg\" data-rel=\"lightbox-gallery-zfU4XbwJ\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" src=\"http:\/\/www.uniqware.net\/wp-content\/uploads\/wc_addmeta-400x282.jpg\" alt=\"WooCommerce\u306e\u5546\u54c1\u8a73\u7d30\u30da\u30fc\u30b8\" width=\"400\" height=\"282\" class=\"aligncenter size-medium wp-image-1705\" \/><\/a>\n\n<br \/>","protected":false},"excerpt":{"rendered":"WooCommerce\u306fWordPress\u30d9\u30fc\u30b9\u306e\u30cd\u30c3\u30c8\u901a\u8ca9\u30b5\u30a4\u30c8\u3092\u69cb\u7bc9\u3059\u308b\u306e\u306b &hellip; <a class=\"more-link\" href=\"https:\/\/www.uniqware.net\/it\/archives\/1693\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[33,30,31,6],"acf":[],"_links":{"self":[{"href":"https:\/\/www.uniqware.net\/it\/wp-json\/wp\/v2\/posts\/1693"}],"collection":[{"href":"https:\/\/www.uniqware.net\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.uniqware.net\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.uniqware.net\/it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.uniqware.net\/it\/wp-json\/wp\/v2\/comments?post=1693"}],"version-history":[{"count":0,"href":"https:\/\/www.uniqware.net\/it\/wp-json\/wp\/v2\/posts\/1693\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.uniqware.net\/it\/wp-json\/wp\/v2\/media?parent=1693"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.uniqware.net\/it\/wp-json\/wp\/v2\/categories?post=1693"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.uniqware.net\/it\/wp-json\/wp\/v2\/tags?post=1693"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}