{"id":1180,"date":"2010-01-02T22:12:10","date_gmt":"2010-01-02T14:12:10","guid":{"rendered":"http:\/\/nan.im\/blog\/?p=1180"},"modified":"2010-01-02T22:12:10","modified_gmt":"2010-01-02T14:12:10","slug":"%e3%80%90wordpress%e3%80%91%e5%a6%82%e4%bd%95%e7%bb%99-wp-%e5%a2%9e%e5%8a%a0%e5%8d%95%e7%af%87%e6%96%87%e7%ab%a0%e5%88%86%e9%a1%b5%e5%8a%9f%e8%83%bd","status":"publish","type":"post","link":"https:\/\/nan.im\/blog\/1180","title":{"rendered":"\u3010WordPress\u3011\u5982\u4f55\u7ed9 WP \u589e\u52a0\u5355\u7bc7\u6587\u7ae0\u7684\u5206\u9875\u529f\u80fd"},"content":{"rendered":"<p>\u76ee\u524d\u7684 WordPress \u867d\u7136\u5185\u6838\u65e9\u5df2\u652f\u6301\u6587\u7ae0\u5206\u9875\u529f\u80fd\uff0c\u4f46\u540e\u53f0\u7f16\u8f91\u5668\u7684\u5206\u9875\u6309\u94ae\u4e00\u76f4\u88ab\u6ce8\u91ca\u6389\uff0c\u5305\u62ec\u5b98\u65b9\u9644\u5e26\u6a21\u677f\u5728\u5185\u7684\u7edd\u5927\u591a\u6570\u6a21\u677f\u4e5f\u5e76\u4e0d\u652f\u6301\u6587\u7ae0\u5206\u9875\u529f\u80fd\u3002\u8fd9\u91cc\u63d0\u4f9b\u4e00\u4e9b\u4ee3\u7801\u5e2e\u52a9\u4f60\u4fee\u6539\u6a21\u677f\u4f7f\u4f60\u7684 WordPress \u524d\u7aef\u652f\u6301\u5355\u6587\u7ae0\u5206\u9875\u7b26\u7684\u663e\u793a\uff0c\u540e\u53f0\u7f16\u8f91\u5668\u4e0a\u4e5f\u6dfb\u52a0\u5206\u9875\u7b26\u6dfb\u52a0\u6309\u94ae\u7b49\u529f\u80fd\uff0c\u800c\u91cd\u8981\u7684\u662f\u4e0d\u6d89\u53ca WordPress \u6838\u5fc3\u4ee3\u7801\uff0c\u672a\u6765\u5347\u7ea7 WordPress \u5c06\u4e0d\u9700\u8981\u4fee\u6539\u8fd9\u4e9b\u4ee3\u7801\u2026\u2026<!--more--><\/p>\n<p>\u4e00\u3001\u9996\u5148\u662f\u4e3a\u540e\u53f0\u7684\u7ba1\u7406\u9875\u9762\u6dfb\u52a0\u4e00\u4e2a JavaScript \u7684\u5165\u53e3\uff0c\u4ee3\u7801\u6dfb\u52a0\u4e8e\u4e3b\u9898\u7684 functions.php \u6587\u4ef6\u4e2d\uff1a<\/p>\n<pre lang=\"php\" line=\"1\">\nif(is_admin()){\n\twp_enqueue_script('admins', WP_CONTENT_URL.'\/...\/jquery.admin.dev.js', array('jquery'), '0.0.9', true);\n}\n<\/pre>\n<p>\u5176\u5b9e\u76f4\u63a5\u6dfb\u52a0\u540e\u9762\u7684 js \u4ee3\u7801\u5230\u7ba1\u7406\u9875\u5e95\u90e8\u4e5f\u53ef\u4ee5\uff0c\u4f46\u4e3a\u4e86\u4ee5\u540e\u4e3a\u540e\u53f0\u7ba1\u7406\u9875\u6dfb\u52a0 js \u7684\u65b9\u4fbf\uff0c\u8fd8\u662f\u5355\u72ec\u653e\u4e00\u4e2a\u6587\u4ef6\u5427\u3002\u8fd9\u91cc\u7528\u5230\u4e86 WordPress \u4e2d\u7528\u6765\u5f15\u5165 JavaScript \u7684 <a href=\"http:\/\/codex.wordpress.org\/Function_Reference\/wp_enqueue_script\">wp_enqueue_script<\/a> \u51fd\u6570\u548c\u5224\u65ad\u662f\u5426\u662f\u7ba1\u7406\u9875\u9762\u7684 is_admin \u51fd\u6570\u3002<\/p>\n<p>\u4e8c\u3001\u7136\u540e\u662f\u4e3a\u6587\u7ae0 HTML \u7f16\u8f91\u5668\u6dfb\u52a0 nextpage \u6309\u94ae\uff0c\u4ee3\u7801\u6dfb\u52a0\u5230\u4e0a\u9762\u5f15\u5165\u7684 admin.dev.js \u6587\u4ef6\u4e2d\uff1a<\/p>\n<pre lang=\"javascript\" line=\"1\">\nif(anyBar = document.getElementById(\"ed_toolbar\")){\n\tvar barSize = edButtons.length; var barLast = anyBar.lastChild;\n\tedButtons[edButtons.length] = new edButton(\"ed_next\",\"page\",\"<! --nextpage-- >\",\"\",\"n\");\n\twhile( barLast.nodeType != 1 ){ barLast = barLast.previousSibling; }\n\tbarLast = barLast.cloneNode(true);\n\tbarLast.id = \"ed_pag\"; barLast._idx = barSize; barLast.value = \"PAGE\"; barLast.title = \"\";\n\tbarLast.onclick = function(){ edInsertTag(edCanvas, this._idx); return false; }\n\tanyBar.appendChild(barLast);\n}\n<\/pre>\n<p>\u5176\u5b9e\u6253\u5f00 wp-includes \u91cc\u9762 js \u76ee\u5f55\u4e0b\u7684 quicktags.dev.js \u4f1a\u53d1\u73b0\u91cc\u9762\u539f\u672c\u5df2\u7ecf\u6709 nextpage \u6309\u94ae\u7684\u4ee3\u7801\u4f46\u88ab\u6ce8\u91ca\u4e86\uff0c\u7ea6\u5728 130 \u884c\u5de6\u53f3\uff0c\u4e0a\u9762\u7528\u5230\u4e86\u4e00\u4e9b\u73b0\u6210\u7684\u63a5\u53e3\uff0c\u4f1a\u628a\u4e00\u4e2a nextpage \u6309\u94ae\u6dfb\u52a0\u5230 HTML \u7f16\u8f91\u5668\u7684\u6700\u540e\u9762\uff0c\u8fd9\u6837\u53ef\u4ee5\u5728 HTML \u7f16\u8f91\u5668\u6a21\u5f0f\u975e\u5e38\u65b9\u4fbf\u7684\u63d2\u5165\u7528\u4e8e\u5206\u9875\u7684 nextpage \u6807\u8bb0\u3002\u4e0a\u9762\u4ee3\u7801\u4e2d\u7684 nextpage \u6309\u94ae\u4e24\u8fb9\u7684\u7a7a\u683c\u662f\u4e3a\u4e86\u9632\u6b62 WordPress \u6587\u7ae0\u8f93\u51fa\u4e3a\u6ce8\u91ca\u52a0\u7684\uff0c\u5b9e\u9645\u5e94\u7528\u65f6\u9700\u8981\u5220\u6389\u3002<\/p>\n<p>\u4e09\u3001\u6700\u540e\u662f\u4e3a\u5206\u9875\u94fe\u63a5\u63d0\u4f9b\u663e\u793a\u4f4d\u7f6e\uff0c\u4fee\u6539\u6a21\u677f\u6587\u4ef6\u5728\u6587\u7ae0\u5185\u5bb9\u8f93\u51fa\u7684\u540e\u9762\u6dfb\u52a0\u4ee3\u7801\uff0c\u901a\u5e38\u662f index.php \u4e2d\u7684 the_content \u51fd\u6570\u8f93\u51fa\u5185\u5bb9\u4e4b\u540e\uff0c\u6dfb\u52a0\u4e00\u4e2a <a href=\"http:\/\/codex.wordpress.org\/Template_Tags\/wp_link_pages\">wp_link_pages<\/a> \u51fd\u6570\u5373\u53ef\uff0c\u5177\u4f53\u7684\u4e00\u4e9b\u51fd\u6570\u53c2\u6570\u53ef\u4ece WordPress \u7f51\u7ad9\u53c2\u8003\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u524d\u7684 WordPress \u867d\u7136\u5185\u6838\u65e9\u5df2\u652f\u6301\u6587\u7ae0\u5206\u9875\u529f\u80fd\uff0c\u4f46\u540e\u53f0\u7f16\u8f91\u5668\u7684\u5206\u9875\u6309\u94ae\u4e00\u76f4\u88ab\u6ce8\u91ca\u6389\uff0c\u5305\u62ec\u5b98\u65b9\u9644\u5e26\u6a21\u677f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[20,24,76,95],"class_list":["post-1180","post","type-post","status-publish","format-standard","hentry","category-tech","tag-code","tag-develop","tag-theme","tag-wordpress"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"_links":{"self":[{"href":"https:\/\/nan.im\/blog\/wp-json\/wp\/v2\/posts\/1180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nan.im\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nan.im\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nan.im\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nan.im\/blog\/wp-json\/wp\/v2\/comments?post=1180"}],"version-history":[{"count":0,"href":"https:\/\/nan.im\/blog\/wp-json\/wp\/v2\/posts\/1180\/revisions"}],"wp:attachment":[{"href":"https:\/\/nan.im\/blog\/wp-json\/wp\/v2\/media?parent=1180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nan.im\/blog\/wp-json\/wp\/v2\/categories?post=1180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nan.im\/blog\/wp-json\/wp\/v2\/tags?post=1180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}