{"id":66,"date":"2009-03-11T09:19:09","date_gmt":"2009-03-11T00:19:09","guid":{"rendered":"http:\/\/www.zontheworld.com\/blog\/?p=66"},"modified":"2009-08-07T11:07:08","modified_gmt":"2009-08-07T02:07:08","slug":"wp27%e4%bb%a5%e9%99%8d%e3%81%ae%e3%83%aa%e3%83%93%e3%82%b8%e3%83%a7%e3%83%b3%e7%ae%a1%e7%90%86%e3%81%a8%e8%87%aa%e5%8b%95%e4%bf%9d%e5%ad%98%e3%82%92%e5%81%9c%e6%ad%a2%e3%81%99%e3%82%8b%e3%83%97-2","status":"publish","type":"post","link":"https:\/\/www.zontheworld.com\/blog\/archives\/66","title":{"rendered":"WP2.7\u4ee5\u964d\u306e\u30ea\u30d3\u30b8\u30e7\u30f3\u7ba1\u7406\u3068\u81ea\u52d5\u4fdd\u5b58\u3092\u505c\u6b62\u3059\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u521d\u7248\u306e\u8a73\u7d30"},"content":{"rendered":"<p><a href=\"https:\/\/www.zontheworld.com\/blog\/archives\/65\" class=\"note\">WP2.7\u4ee5\u964d\u306e\u30ea\u30d3\u30b8\u30e7\u30f3\u7ba1\u7406\u3068\u81ea\u52d5\u4fdd\u5b58\u3092\u505c\u6b62\u3059\u308b\u30d7\u30e9\u30b0\u30a4\u30f3<\/a> \u3067\u914d\u5e03\u3057\u3066\u3044\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u521d\u7248\u306e\u51e6\u7406\u5185\u5bb9\u306e\u8a73\u7d30\u306f\u4ee5\u4e0b\u3002<\/p>\n<p>\u30d0\u30fc\u30b8\u30e7\u30f3\u306f 0 \u306b\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p><!--more--><\/p>\n<h3>\u30d7\u30ec\u30d3\u30e5\u30fc\u30af\u30ea\u30c3\u30af\u6642\u306e\u81ea\u52d5\u4fdd\u5b58\u306e\u4ed5\u7d44\u307f<\/h3>\n<p>\/wp-admin\/js\/post.js \u3067\u30d7\u30ec\u30d3\u30e5\u30fc\u306e\u30af\u30ea\u30c3\u30af\u3092\u30d5\u30c3\u30af\u3057\u3066\u3044\u308b\u3002<br \/>\n\u51e6\u7406\u306f submit \u3067 \/wp-admin\/post.php \u306b\u6295\u3052\u3066\u3044\u308b\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n$('#post-preview').click(function(e){\r\nif ( 1 &gt; $('#post_ID').val() &amp;&amp; autosaveFirst ) {\r\n    autosaveDelayPreview = true;\r\n    autosave();\r\n    return false;\r\n}\r\n\r\n$('input#wp-preview').val('dopreview');\r\n$('form#post').attr('target', 'wp-preview').submit().attr('target', '');\r\n$('input#wp-preview').val('');\r\nreturn false;\r\n});\r\n<\/pre>\n<p>\/wp-admin\/post.php \u306e post_preview() \u3067\u3001\u3068\u3042\u308b\u51e6\u7406\u3092\u3057\u3066\u30d7\u30ec\u30d3\u30e5\u30fc\u753b\u9762\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3057\u3066\u3044\u308b\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nelseif ( isset($_POST['wp-preview']) &amp;&amp; 'dopreview' == $_POST['wp-preview'] )\r\n    $action = 'preview';\r\n\uff08\u4e2d\u7565\uff09\r\ncase 'preview':\r\n    check_admin_referer( 'autosave', 'autosavenonce' );\r\n\r\n    $url = post_preview();\r\n\r\n    wp_redirect($url);\r\n    exit();\r\n    break;\r\n<\/pre>\n<p>post_preview() \u306e\u51e6\u7406\u306b\u306f\u4e0b\u66f8\u304d\u4ee5\u5916\u306e\u8a18\u4e8b\u306f\u81ea\u52d5\u4fdd\u5b58\u3059\u308b\u51e6\u7406\u3042\u308b\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nif ( 'draft' == $post-&gt;post_status ) {\r\n    $id = edit_post();\r\n} else { \/\/ Non drafts are not overwritten.  The autosave is stored in a special post revision.\r\n    $id = wp_create_post_autosave( $post-&gt;ID );\r\n    if ( ! is_wp_error($id) )\r\n        $id = $post-&gt;ID;\r\n}\r\n<\/pre>\n<p>\u305d\u3093\u306a\u611f\u3058\u3067\u81ea\u52d5\u4fdd\u5b58\u3055\u308c\u3066\u3057\u307e\u3046\u3002<\/p>\n<h3>\u5bfe\u51e6\u65b9\u6cd5<\/h3>\n<p>\u5bfe\u51e6\u65b9\u6cd5\u306f\u4ee5\u4e0b\u306e\u65b9\u6cd5\u304c\u8003\u3048\u3089\u308c\u308b\u3002<\/p>\n<p>$(&#8216;#post-preview&#8217;).click \u3092\u30d5\u30c3\u30af\u3055\u305b\u306a\u3044\u3002<\/p>\n<p>\u307e\u305f\u306f\u3001post_preview() \u3092\u547c\u3070\u305a\u306b\u30d7\u30ec\u30d3\u30e5\u30fc\u753b\u9762\u3078\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3002<\/p>\n<p>JavaScript \u306f\u82e6\u624b\u306a\u306e\u3068\u3001PHP \u306e\u51e6\u7406\u3092\u6291\u3048\u3066\u304a\u304f\u307b\u3046\u304c\u5b89\u5fc3\u306a\u306e\u3067\u5f8c\u8005\u3092\u9078\u629e\u3059\u308b\u3002<\/p>\n<h3>\u30d7\u30e9\u30b0\u30a4\u30f3\u4f5c\u6210<\/h3>\n<p>\u4e0b\u8a18\u306e\u51e6\u7406\u3092\u3059\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u5165\u308c\u308b\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\ndefine('WP_POST_REVISIONS', false);\r\nfunction disable_autosave_script() {\r\n    wp_deregister_script('autosave');\r\n}\r\nfunction disable_autosave_check_admin_referer($action, $result) {\r\n    if ($action != 'autosave') return $result;\r\n    $url = get_permalink((int)$_POST['post_ID']);\r\n    wp_redirect($url);\r\n    exit();\r\n}\r\nadd_action('wp_print_scripts', 'disable_autosave_script');\r\nadd_action('check_admin_referer', 'disable_autosave_check_admin_referer', 10, 2);\r\n<\/pre>\n<h3>\u30c8\u30ec\u30fc\u30c9\u30aa\u30d5<\/h3>\n<p>\u30d0\u30b0\u304b\u3068\u601d\u3063\u3066\u3044\u305f\u3051\u3069\u3001\u30d7\u30ec\u30d3\u30e5\u30fc\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f\u3089\u7de8\u96c6\u753b\u9762\u306b\u66f8\u304b\u308c\u3066\u3042\u308b\u72b6\u614b\u3092\u30d7\u30ec\u30d3\u30e5\u30fc\u3057\u3066\u304f\u308c\u308b\u3068\u3044\u3046\u4ed5\u69d8\u306e\u3088\u3046\u306a\u6c17\u304c\u3057\u3066\u304d\u305f\u3002<\/p>\n<p>\u3053\u3046\u3059\u308b\u3053\u3068\u3067\u3001\u516c\u958b\u5f8c\u306b\u5909\u66f4\u3057\u305f\u72b6\u614b\u3092\u898b\u305f\u3044\u5834\u5408\u306b\u5909\u66f4\u8a18\u4e8b\u3092\u81ea\u5206\u3060\u3051\u304c\u898b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002\u3057\u304b\u3057\u3001\u3053\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u5165\u308c\u308b\u3068\u516c\u958b\u5f8c\u306f\u66f4\u65b0\u3092\u3057\u3066\u8ab0\u3067\u3082\u898b\u308c\u308b\u72b6\u614b\u306b\u3057\u306a\u3044\u3068\u898b\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u3044\u306e\u3067\u3001\u7de8\u96c6\u4e2d\u306b\u78ba\u8a8d\u3059\u308b\u5834\u5408\u3067\u3082\u7b2c\u4e09\u8005\u304c\u95b2\u89a7\u3067\u304d\u308b\u72b6\u614b\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u3002<\/p>\n<p>\u4e0b\u8a18\u306e\u5bfe\u51e6\u306e\u5f71\u97ff\u3060\u3068\u3059\u308b\u3068\u691c\u8a0e\u4e0d\u5341\u5206\u306e\u6c17\u3082\u3059\u308b\u3002\u81ea\u52d5\u4fdd\u5b58\u3092\u7121\u52b9\u306b\u3057\u305f\u3044\u4eba\u306e\u3053\u3068\u307e\u3067\u6c17\u306b\u3059\u308b\u5fc5\u8981\u306f\u306a\u3044\u3068\u8003\u3048\u3066\u3044\u308b\u6c17\u3082\u3059\u308b\u3002\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u5bfe\u51e6\u3067\u304d\u308b\u4f59\u5730\u304c\u3042\u308b\u306e\u3067\u3001\u8003\u3048\u3066\u304f\u308c\u3066\u306f\u3044\u308b\u306e\u3060\u308d\u3046\u3002<\/p>\n<blockquote cite=\"http:\/\/s-srv.net\/archives\/181\" title=\"\u3055\u3070\u304b\u3093 \u81ea\u5b85\u30b5\u30fc\u30d0\u30fcBlog - WordPress 2.7 \u65e5\u672c\u8a9e \u6b63\u5f0f\u7248\u516c\u958b\">\n<p>\u7d30\u304b\u3044\u3051\u3069\u30e6\u30fc\u30b6\u30d3\u30ea\u30c6\u30a3\u304c\u5411\u4e0a\u3057\u3066\u308b\u3068\u3053\u308d\uff08\u4e0b\u66f8\u304d\u306e\u81ea\u52d5\u4fdd\u5b58\u304c\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u8868\u793a\u3055\u308c\u305f\u308a\u3068\u304b\uff09<\/p>\n<p class=\"citation\"><a href=\"http:\/\/s-srv.net\/archives\/181\"><cite>\u3055\u3070\u304b\u3093 \u81ea\u5b85\u30b5\u30fc\u30d0\u30fcBlog &#8211; WordPress 2.7 \u65e5\u672c\u8a9e \u6b63\u5f0f\u7248\u516c\u958b<\/cite><\/a><\/p>\n<\/blockquote>\n<p>\u3044\u305a\u308c\u306b\u305b\u3088\u3001\u3069\u3061\u3089\u3082\u305d\u308c\u306a\u308a\u306b\u610f\u5473\u304c\u3042\u308b\u306e\u3067\u3001\u30e1\u30ea\u30c3\u30c8\u3001\u30c7\u30e1\u30ea\u30c3\u30c8\u3092\u5224\u65ad\u3057\u305f\u4e0a\u3067\u63a1\u7528\u3092\u6c7a\u3081\u305f\u307b\u3046\u304c\u3088\u3044\u3002<\/p>\n<h3>\u53c2\u8003<\/h3>\n<p>\u306f\u3058\u3081\u306f\u3001JavaScript \u3067\u5bfe\u51e6\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u305f\u306e\u3067\u305d\u306e\u3068\u304d\u306e\u8abf\u3079\u3082\u306e\u3002<br \/>\n<a href=\"http:\/\/semooh.jp\/jquery\/\" class=\"note\">jQuery 1.3.2 \u65e5\u672c\u8a9e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9<\/a><br \/>\n<a href=\"http:\/\/hisasann.com\/housetect\/2008\/01\/jqueryreadyonload.html\" class=\"note\">jQuery\u306eready\u30e1\u30bd\u30c3\u30c9\u306fonload\u30a4\u30d9\u30f3\u30c8\u3088\u308a\u524d\u306b\u547c\u3070\u308c\u308b at HouseTect, JavaScripter Blog<\/a><br \/>\n<a href=\"http:\/\/hkom.blog1.fc2.com\/blog-entry-614.html\" class=\"note\">jQuery()\u306e\u6319\u52d5\u3092\u89e3\u8aad\u3059\u308b(21) $(document).ready(f)\u3001bindReady()\u3001$.ready() \u89e3\u8aad \u2500\u2500jQuery\u89e3\u8aad(32)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>WP2.7\u4ee5\u964d\u306e\u30ea\u30d3\u30b8\u30e7\u30f3\u7ba1\u7406\u3068\u81ea\u52d5\u4fdd\u5b58\u3092\u505c\u6b62\u3059\u308b\u30d7\u30e9\u30b0\u30a4\u30f3 \u3067\u914d\u5e03\u3057\u3066\u3044\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u521d\u7248\u306e\u51e6\u7406\u5185\u5bb9\u306e\u8a73\u7d30\u306f\u4ee5\u4e0b\u3002 \u30d0\u30fc\u30b8\u30e7\u30f3\u306f 0 \u306b\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[57,16,54,17],"_links":{"self":[{"href":"https:\/\/www.zontheworld.com\/blog\/wp-json\/wp\/v2\/posts\/66"}],"collection":[{"href":"https:\/\/www.zontheworld.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zontheworld.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zontheworld.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zontheworld.com\/blog\/wp-json\/wp\/v2\/comments?post=66"}],"version-history":[{"count":0,"href":"https:\/\/www.zontheworld.com\/blog\/wp-json\/wp\/v2\/posts\/66\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zontheworld.com\/blog\/wp-json\/wp\/v2\/media?parent=66"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zontheworld.com\/blog\/wp-json\/wp\/v2\/categories?post=66"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zontheworld.com\/blog\/wp-json\/wp\/v2\/tags?post=66"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}