{"id":3106,"date":"2019-01-18T15:44:06","date_gmt":"2019-01-18T06:44:06","guid":{"rendered":"http:\/\/taitan916.info\/blog\/?p=3106"},"modified":"2024-02-20T17:42:48","modified_gmt":"2024-02-20T08:42:48","slug":"post-3106","status":"publish","type":"post","link":"https:\/\/taitan916.info\/blog\/archives\/3106","title":{"rendered":"WordPress\u3067\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u3068CSV\u30d5\u30a1\u30a4\u30eb\u6295\u7a3f\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>WordPress\u3067\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u74b0\u5883\u306b\u3001CSV\u30d5\u30a1\u30a4\u30eb\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3067\u8a18\u4e8b\u6295\u7a3f\u3092\u884c\u3044\u305f\u304b\u3063\u305f\u3002\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u8a2d\u5b9a\u306f<a href=\"https:\/\/ja.wordpress.org\/plugins\/advanced-custom-fields\/\" target=\"_blank\" rel=\"noopener\">Advanced Custom Fields<\/a>\u3092\u3001CSV\u30d5\u30a1\u30a4\u30eb\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u6295\u7a3f\u306f<a href=\"https:\/\/wordpress.org\/plugins\/really-simple-csv-importer\/\" target=\"_blank\" rel=\"noopener\">Really Simple CSV Importer<\/a>\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u7528\u3059\u308b\u3002\u4ee5\u4e0b\u306b\u65b9\u6cd5\u3092\u30e1\u30e2\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u8a2d\u5b9a<\/h2>\n<p>\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u8a2d\u5b9a\u306f\u4ee5\u4e0b\u3092\u60f3\u5b9a\u3059\u308b\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<td>\u30d5\u30a9\u30fc\u30e0\u5185\u5bb9<\/td>\n<td>\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u540d\u524d<\/td>\n<\/tr>\n<tr>\n<td>\u30c6\u30ad\u30b9\u30c8\u30dc\u30c3\u30af\u30b9<\/td>\n<td>csv_text<\/td>\n<\/tr>\n<tr>\n<td>\u30c6\u30ad\u30b9\u30c8\u30a8\u30ea\u30a2<\/td>\n<td>csv_textarea<\/td>\n<\/tr>\n<tr>\n<td>\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9<\/td>\n<td>csv_checkbox<\/td>\n<\/tr>\n<tr>\n<td>\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3<\/td>\n<td>csv_radio<\/td>\n<\/tr>\n<tr>\n<td>\u30bb\u30ec\u30af\u30c8\u30e1\u30cb\u30e5\u30fc<\/td>\n<td>csv_select<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2>\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u306f\u6ce8\u610f\u304c\u5fc5\u8981<\/h2>\n<p>\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u306e\u307f\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u30ab\u30b9\u30bf\u30e0\u3059\u308b\u304b\u3001\u5225\u9014\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u5165\u308c\u308b\u3082\u3057\u304f\u306f\u4f5c\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u4eca\u56de\u306f\u5225\u9014\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f5c\u308b\u65b9\u6cd5\u3067\u5bfe\u5fdc\u3002<\/p>\n<p>\/wp-content\/plugins\/\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306bacf-custom\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210\u3002\u305d\u306e\u30d5\u30a9\u30eb\u30c0\u5185\u306bacf-custom.php\u3092\u4f5c\u6210\u3057\u3001\u4ee5\u4e0b\u5185\u5bb9\u3092\u8ffd\u8a18\u3059\u308b\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?php\r\n\/*  Plugin Name: acf-custom  *\/\r\n\r\nfunction adf_custom( $meta, $post, $is_update ) {\r\n\r\n    \/\/\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u306e\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u540d\r\n    $checkbox = array(\r\n        'csv_checkbox'\r\n    );\r\n\r\n    foreach( $meta as $key =&gt; $val){\r\n\r\n        \/\/checkbox\r\n        if( in_array($key, $checkbox) ){\r\n            if( $val != \"\" ){\r\n                $meta[$key] = preg_split(\"\/,+\/\", $val);\r\n            }else{\r\n                $meta_array[$key] = \"\";\r\n            }\r\n        }\r\n\r\n    }\r\n    return $meta;\r\n}\r\nadd_filter( 'really_simple_csv_importer_save_meta', 'adf_custom', 10, 3 );<\/pre>\n<p>&nbsp;<\/p>\n<h2>CSV\u30d5\u30a1\u30a4\u30eb\u5185\u5bb9<\/h2>\n<p>CSV\u30d5\u30a1\u30a4\u30eb\u5185\u5bb9\u3092\u5165\u529b\u3059\u308b\u969b\u306f\u4ee5\u4e0b\u3092\u53c2\u8003\u306b\u3059\u308b\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<td>\u30d5\u30a9\u30fc\u30e0\u5185\u5bb9<\/td>\n<td>\u66f8\u304d\u65b9<\/td>\n<\/tr>\n<tr>\n<td>\u30c6\u30ad\u30b9\u30c8\u30dc\u30c3\u30af\u30b9<\/td>\n<td>\u30c0\u30d6\u30eb\u30af\u30aa\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u306a\u3057<\/td>\n<\/tr>\n<tr>\n<td>\u30c6\u30ad\u30b9\u30c8\u30a8\u30ea\u30a2<\/td>\n<td>\u30c0\u30d6\u30eb\u30af\u30aa\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3042\u308a<br \/>\n\u6539\u884c\u53ef<\/td>\n<\/tr>\n<tr>\n<td>\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9<\/td>\n<td>\u30ab\u30f3\u30de\u533a\u5207\u308a\u306b\u3057\u305f\u5185\u5bb9\u3092\u30c0\u30d6\u30eb\u30af\u30aa\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u56f2\u3080<\/td>\n<\/tr>\n<tr>\n<td>\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3<\/td>\n<td>\u30c0\u30d6\u30eb\u30af\u30aa\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u306a\u3057<\/td>\n<\/tr>\n<tr>\n<td>\u30bb\u30ec\u30af\u30c8\u30e1\u30cb\u30e5\u30fc<\/td>\n<td>\u30c0\u30d6\u30eb\u30af\u30aa\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u306a\u3057<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>WordPress\u3067\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u74b0\u5883\u306b\u3001CSV\u30d5\u30a1\u30a4\u30eb\u30a2\u30c3\u30d7\u30ed ... <\/p>\n","protected":false},"author":1,"featured_media":1093,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[24],"tags":[93,97],"class_list":["post-3106","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-csv","tag-advanced-custom-fields"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/3106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/comments?post=3106"}],"version-history":[{"count":3,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/3106\/revisions"}],"predecessor-version":[{"id":4757,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/3106\/revisions\/4757"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media\/1093"}],"wp:attachment":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media?parent=3106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/categories?post=3106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/tags?post=3106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}