{"id":4727,"date":"2016-01-09T23:47:14","date_gmt":"2016-01-09T15:47:14","guid":{"rendered":"https:\/\/sdeno.com\/?p=4727"},"modified":"2016-01-11T11:01:16","modified_gmt":"2016-01-11T03:01:16","slug":"wordpress%e7%a6%81%e7%94%a8%e6%97%a0%e7%94%a8%e7%9a%84%e5%8a%9f%e8%83%bd%e6%8f%90%e5%8d%87%e9%80%9f%e5%ba%a6","status":"publish","type":"post","link":"https:\/\/sdeno.com\/?p=4727","title":{"rendered":"wordpress\u7981\u7528\u65e0\u7528\u7684\u529f\u80fd\u4f18\u5316\u63d0\u5347\u901f\u5ea6"},"content":{"rendered":"<p>\u6211\u7684wp\u4f18\u5316 wordpress \u7981\u7528<\/p>\n<p><a href=\"https:\/\/sdeno.com\/wp-content\/uploads\/2016\/01\/wordpress_up.txt\">wordpress_up<\/a><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\">1\uff0c<\/span>\u7981\u6b62wp\u66f4\u65b0 : open file &#8220;wordpress\\wp-includes\\update.php&#8221;.<\/p>\n<p>add_filter(&#8216;pre_site_transient_update_core&#8217;, create_function(&#8216;$a&#8217;, &#8216;return null;&#8217;)); \/\/ \u5173\u95ed\u6838\u5fc3\u63d0\u793a<\/p>\n<p>add_filter(&#8216;pre_site_transient_update_plugins&#8217;, create_function(&#8216;$a&#8217;, &#8216;return null;&#8217;)); \/\/ \u5173\u95ed\u63d2\u4ef6\u63d0\u793a<\/p>\n<p>add_filter(&#8216;pre_site_transient_update_themes&#8217;, create_function(&#8216;$a&#8217;, &#8216;return null;&#8217;)); \/\/ \u5173\u95ed\u4e3b\u9898\u63d0\u793a<\/p>\n<p>remove_action(&#8216;admin_init&#8217;, &#8216;_maybe_update_core&#8217;); \/\/ \u7981\u6b62 WordPress \u68c0\u67e5\u66f4\u65b0<\/p>\n<p>remove_action(&#8216;admin_init&#8217;, &#8216;_maybe_update_plugins&#8217;); \/\/ \u7981\u6b62 WordPress \u66f4\u65b0\u63d2\u4ef6<\/p>\n<p>remove_action(&#8216;admin_init&#8217;, &#8216;_maybe_update_themes&#8217;); \/\/ \u7981\u6b62 WordPress \u66f4\u65b0\u4e3b\u9898<br \/>\n<span style=\"color: #ff0000;\">2\uff0c<\/span>\u5c06\u4e0b\u9762\u7684\u4ee3\u7801\u6dfb\u52a0\u5230\u5f53\u524d\u4e3b\u9898\u7684 functions.php \u6587\u4ef6\uff0c\u5373\u53ef\u7981\u7528\u6240\u6709\u9875\u9762\u7684\u8bc4\u8bba\u529f\u80fd\uff1a<br \/>\nfunction disable_page_comments( $posts ) {<br \/>\nif ( is_page()) {<br \/>\n$posts[0]-&gt;comment_status = &#8216;disabled&#8217;;<br \/>\n$posts[0]-&gt;ping_status = &#8216;disabled&#8217;;<br \/>\n}<br \/>\nreturn $posts;<br \/>\n}<br \/>\nadd_filter( &#8216;the_posts&#8217;, &#8216;disable_page_comments&#8217; );<br \/>\n<span style=\"color: #ff0000;\">3\uff0c<\/span>\u7981\u7528\u53ca\u5220\u9664\u7248\u672c\u4fee\u8ba2\u5386\u53f2<br \/>\n\u7248\u672c\u4fee\u8ba2\u5386\u53f2\u5728\u6bcf\u4e00\u6b21\u7f16\u8f91\u6587\u7ae0\u8fc7\u540e\uff0c\u90fd\u4f1a\u81ea\u52a8\u4fdd\u7559\u4e00\u4efd\uff0c\u8fd9\u6837\u7684\u8bdd\u5f88\u5bb9\u6613\u9020\u6210\u6570\u636e\u7684\u91cd\u590d\u50a8\u5b58\uff0c\u5360\u7528\u4e0d\u5fc5\u8981\u7684\u8d44\u6e90\u3002<br \/>\n\u6253\u5f00wp-config.php\uff0c\u5728\u672b\u5c3e\u6dfb\u52a0<br \/>\ndefine(&#8216;WP_POST_REVISIONS&#8217;, false);<br \/>\n<span style=\"color: #ff0000;\">4\uff0c<\/span>\u7981\u7528\u81ea\u52a8\u4fdd\u5b58<br \/>\n\u5728wp-admin\u76ee\u5f55\uff0c\u6253\u5f00post.php\u3001page.php\u3001post-new.php\u548cpage-new.php\uff0c\u67e5\u627e<\/p>\n<p>wp_enqueue_script(&#8216;autosave&#8217;);<\/p>\n<p>\u66ff\u6362\u4e3a<\/p>\n<p>\/\/wp_enqueue_script(&#8216;autosave&#8217;);<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\">5\uff0c<\/span>\u7981\u7528\u81ea\u52a8\u8349\u7a3f<\/p>\n<p>\u5728wp-admin\/includes\u76ee\u5f55\uff0c\u6253\u5f00post.php\uff0c\u67e5\u627e<\/p>\n<p>if ( $create_in_db ) {<br \/>\n$post_id = wp_insert_post( array( &#8216;post_title&#8217; =&gt; __( &#8216;Auto Draft&#8217; ), &#8216;post_type&#8217; =&gt; $post_type, &#8216;post_status&#8217; =&gt; &#8216;auto-draft&#8217; ) );<br \/>\n$post = get_post( $post_id );<br \/>\nif ( current_theme_supports( &#8216;post-formats&#8217; ) &amp;&amp; post_type_supports( $post-&gt;post_type, &#8216;post-formats&#8217; ) &amp;&amp; get_option( &#8216;default_post_format&#8217; ) )<br \/>\nset_post_format( $post, get_option( &#8216;default_post_format&#8217; ) );<br \/>\n}<\/p>\n<p>\u66ff\u6362\u4e3a<\/p>\n<p>if ( $create_in_db ) {<br \/>\nglobal $current_user;<br \/>\n$post = $wpdb-&gt;get_row( &#8220;SELECT * FROM $wpdb-&gt;posts WHERE post_status = &#8216;auto-draft&#8217; AND post_type = &#8216;$post_type&#8217; AND post_author = $current_user-&gt;ID ORDER BY ID ASC LIMIT 1&#8221; );<br \/>\nif ( !$post ) {<br \/>\n$post_id = wp_insert_post( array( &#8216;post_title&#8217; =&gt; __( &#8216;Auto Draft&#8217; ), &#8216;post_type&#8217; =&gt; $post_type, &#8216;post_status&#8217; =&gt; &#8216;auto-draft&#8217; ) );<br \/>\n$post = get_post( $post_id );<br \/>\n}<br \/>\nif ( current_theme_supports( &#8216;post-formats&#8217; ) &amp;&amp; post_type_supports( $post-&gt;post_type, &#8216;post-formats&#8217; ) &amp;&amp; get_option( &#8216;default_post_format&#8217; ) )<br \/>\nset_post_format( $post, get_option( &#8216;default_post_format&#8217; ) );<br \/>\n}<br \/>\n<a href=\"http:\/\/www.pythoner.com\/27.html\" target=\"_blank\">WordPress\u7981\u6b62\u7248\u672c\u4fee\u8ba2\u5386\u53f2\u3001\u81ea\u52a8\u4fdd\u5b58\u548c\u81ea\u52a8\u8349\u7a3f<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u7684wp\u4f18\u5316 wordpress \u7981\u7528 wordpress_up &nbsp; 1\uff0c\u7981\u6b62wp\u66f4\u65b0 : open [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,23],"tags":[],"class_list":["post-4727","post","type-post","status-publish","format-standard","hentry","category-wordpress","category-wp"],"_links":{"self":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/4727","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4727"}],"version-history":[{"count":0,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/4727\/revisions"}],"wp:attachment":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}