{"id":4906,"date":"2025-11-21T10:34:11","date_gmt":"2025-11-21T02:34:11","guid":{"rendered":"https:\/\/www.zhaozhao123.cn\/wpcms\/bjjc\/4906.html"},"modified":"2025-11-21T10:34:12","modified_gmt":"2025-11-21T02:34:12","slug":"wordpress%e6%96%87%e7%ab%a0%e5%bd%a2%e5%bc%8f%e5%88%86%e7%b1%bb%e5%9c%a8%e5%9d%97%e4%b8%bb%e9%a2%98%e4%b8%ad%e7%9a%84%e4%bd%bf%e7%94%a8","status":"publish","type":"bjjc","link":"https:\/\/www.zhaozhao123.cn\/wpcms\/bjjc\/4906.html","title":{"rendered":"WordPress\u6587\u7ae0\u5f62\u5f0f\u5206\u7c7b\u5728\u5757\u4e3b\u9898\u4e2d\u7684\u4f7f\u7528"},"content":{"rendered":"<p>WordPress\u6587\u7ae0\u5f62\u5f0f\u5206\u7c7b\u5728\u5757\u4e3b\u9898\u4e2d\u7684\u4f7f\u7528\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u6267\u884c\u5373\u53ef\u3002<\/p><h2 class=\"wp-block-heading\">\u542f\u7528\u6587\u7ae0\u5f62\u5f0f\u652f\u6301<\/h2><p>\u5728\u4e3b\u9898\u7684functions.php\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p><pre class=\"wp-block-code\"><code>\/\/ \u542f\u7528\u6587\u7ae0\u5f62\u5f0f\u652f\u6301\nfunction my_theme_setup() {\n    \/\/ \u6dfb\u52a0\u6587\u7ae0\u5f62\u5f0f\u652f\u6301\n    add_theme_support('post-formats', array(\n        'aside',   \/\/ \u65e5\u5fd7\n        'gallery', \/\/ \u76f8\u518c\n        'link',    \/\/ \u94fe\u63a5\n        'image',   \/\/ \u56fe\u50cf\n        'quote',   \/\/ \u5f15\u7528\n        'status',  \/\/ \u72b6\u6001\n        'video',   \/\/ \u89c6\u9891\n        'audio',    \/\/ \u97f3\u9891\n        'chat'     \/\/ \u804a\u5929\n    ));\n}\nadd_action('after_setup_theme', 'my_theme_setup');<\/code><\/pre><h2 class=\"wp-block-heading\">\u6ce8\u518c\u5b9a\u4e49\u7ed1\u5b9a\u6e90<\/h2><p>\u5728\u4e3b\u9898\u7684functions.php\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p><pre class=\"wp-block-code\"><code>\/\/ Registers block binding sources.\nif ( ! function_exists( 'yixiuk2_register_block_bindings' ) ) :\n\t\/**\n\t * Registers the post format block binding source.\n\t *\n\t * @since yixiuk2 1.0\n\t *\n\t * @return void\n\t *\/\n\tfunction yixiuk2_register_block_bindings() {\n\t\tregister_block_bindings_source(\n\t\t\t'yixiuk2\/format',\n\t\t\tarray(\n\t\t\t\t'label'              =&gt; _x( '\u6587\u7ae0\u683c\u5f0f\u540d\u79f0', 'Label for the block binding placeholder in the editor', 'yixiuk2' ),\n\t\t\t\t'get_value_callback' =&gt; 'yixiuk2_format_binding',\n\t\t\t)\n\t\t);\n\t}\nendif;\nadd_action( 'init', 'yixiuk2_register_block_bindings' );\n\n\/\/ Registers block binding callback function for the post format name.\nif ( ! function_exists( 'yixiuk2_format_binding' ) ) :\n\t\/**\n\t * Callback function for the post format name block binding source.\n\t *\n\t * @since yixiuk2 1.0\n\t *\n\t * @return string|void Post format name, or nothing if the format is 'standard'.\n\t *\/\n\tfunction yixiuk2_format_binding() {\n\t\t$post_format_slug = get_post_format();\n\n\t\tif ( $post_format_slug &amp;&amp; 'standard' !== $post_format_slug ) {\n\t\t\treturn get_post_format_string( $post_format_slug );\n\t\t}\n\t}\nendif;<\/code><\/pre><h2 class=\"wp-block-heading\">\u81ea\u5b9a\u4e49\u533a\u5757\u5e94\u7528\u524d\u53f0<\/h2><p>\u5728\u5757\u4e3b\u9898\u7684 patterns \u6587\u4ef6\u5939\u4e2d\u5b9a\u4e49\u4e00\u4e2a xxx.php \u6587\u4ef6\uff0c\u5e76\u5728\u6838\u5fc3\u5c55\u793a\u5185\u5bb9\u7684\u90e8\u5206\u6dfb\u52a0\u5982\u4e0b\u4ee3\u7801:<\/p><pre class=\"wp-block-code\"><code>&lt;!-- wp:paragraph {\"metadata\":{\"bindings\":{\"content\":{\"source\":\"yixiuk2\/format\"}}},\"fontSize\":\"small\"} --&gt;\n&lt;p class=\"has-small-font-size\"&gt;&lt;\/p&gt;\n&lt;!-- \/wp:paragraph --&gt;<\/code><\/pre><p>\u518d\u6309\u7167WordPress\u5757\u4e3b\u9898\u5f00\u53d1\u903b\u8f91\uff0c\u5b8c\u6210\u5176\u4ed6\u914d\u7f6e\u3002<\/p><p>\u6216\u8005\uff0c\u66f4\u8be6\u7ec6\u4e00\u4e9b\u662f\u8fd9\u6837\uff1a<\/p><blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u5728\u5757\u4e3b\u9898\u7684 patterns \u6587\u4ef6\u5939\u4e2d\u5b9a\u4e49\u4e00\u4e2a binding-format.php \u6587\u4ef6\uff0c\u5e76\u5728\u6838\u5fc3\u5c55\u793a\u5185\u5bb9\u7684\u90e8\u5206\u6dfb\u52a0\u5982\u4e0b\u4ee3\u7801:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\/**\n * Title: Post format name\n * Slug: twentytwentyfive\/binding-format\n * Categories: twentytwentyfive_post-format\n * Description: Prints the name of the post format with the help of the Block Bindings API.\n *\n * @package WordPress\n * @subpackage Twenty_Twenty_Five\n * @since Twenty Twenty-Five 1.0\n *\/\n\n?&gt;\n&lt;!-- wp:paragraph {\"metadata\":{\"bindings\":{\"content\":{\"source\":\"twentytwentyfive\/format\"}}},\"fontSize\":\"small\"} --&gt;\n&lt;p class=\"has-small-font-size\"&gt;&lt;\/p&gt;\n&lt;!-- \/wp:paragraph --&gt;<\/code><\/pre>\n\n\n\n<p>\u4ee5\u4e0a\u4ee3\u7801\u6458\u81eaWordPress\u5b98\u65b9twentytwentyfive\u4e3b\u9898\uff1b<\/p>\n\n\n\n<p>\u6ce8\u610f\uff1a\u4fee\u6539\u4ee3\u7801\u4e2d\u5934\u90e8\u4fe1\u606f\uff01<\/p>\n\n\n\n<p>\u4e4b\u540e\uff0c\u4e3b\u9898 parts \u6587\u4ef6\u4e2d\u7684\u5bf9\u5e94\u6587\u4ef6\u3001theme.json \u4e2d\u7684\u914d\u7f6e\uff0c\u5747\u6309\u7167\u5757\u4e3b\u9898\u903b\u8f91\u914d\u7f6e\u5373\u53ef\uff0c\u4e0d\u61c2\u5f97\u540c\u5b66\u67e5\u9605WordPress\u5b98\u65b9\u4e3b\u9898 twentytwentyfive \u3002<\/p>\n<\/blockquote><p>\u4e4b\u540e\uff0c\u6211\u4eec\u5c31\u5b8c\u5168\u914d\u7f6e\u7ed3\u675f\u3002\u53ef\u4ee5\u901a\u8fc7\u533a\u5757\u6765\u81ea\u7531\u914d\u7f6e\u5e03\u5c40\u4e86\u3002<\/p>","protected":false},"excerpt":{"rendered":"<p>WordPress\u6587\u7ae0\u5f62\u5f0f\u5206\u7c7b\u5728\u5757\u4e3b\u9898\u4e2d\u7684\u4f7f\u7528\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u6267\u884c\u5373\u53ef\u3002 \u542f\u7528\u6587\u7ae0\u5f62\u5f0f\u652f\u6301 \u5728\u4e3b\u9898\u7684functions.php\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a \u6ce8\u518c\u5b9a\u4e49\u7ed1\u5b9a\u6e90 \u5728\u4e3b\u9898\u7684functions.php\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a \u81ea\u5b9a\u4e49\u533a\u5757\u5e94\u7528\u524d\u53f0 \u5728\u5757\u4e3b\u9898\u7684 patterns \u6587\u4ef6\u5939\u4e2d\u5b9a\u4e49\u4e00\u4e2a xxx.php \u6587\u4ef6\uff0c\u5e76\u5728\u6838\u5fc3\u5c55\u793a\u5185..<\/p>\n","protected":false},"author":1,"featured_media":0,"menu_order":0,"template":"","meta":{"_acf_changed":true},"tags":[],"bjjc2nav":[23],"tuisongtax":[],"class_list":["post-4906","bjjc","type-bjjc","status-publish","hentry","bjjc2nav-kuaizhuti"],"acf":{"qian_art_seotitle":"WordPress\u6587\u7ae0\u5f62\u5f0f\u5206\u7c7b\u5728\u5757\u4e3b\u9898\u4e2d\u7684\u4f7f\u7528","qian_art_seotitle_source":{"label":"SEO\u6807\u9898","type":"text","formatted_value":"WordPress\u6587\u7ae0\u5f62\u5f0f\u5206\u7c7b\u5728\u5757\u4e3b\u9898\u4e2d\u7684\u4f7f\u7528"},"qian_art_seokws":"","qian_art_seokws_source":{"label":"SEO\u5173\u952e\u8bcd","type":"text","formatted_value":""},"qian_art_stzhong":"\u6587\u7ae0\u5f62\u5f0f\u5206\u7c7b  \u5757\u4e3b\u9898\u5e94\u7528","qian_art_stzhong_source":{"label":"\u4e2d | \u77ed\u6807\u9898","type":"text","formatted_value":"\u6587\u7ae0\u5f62\u5f0f\u5206\u7c7b  \u5757\u4e3b\u9898\u5e94\u7528"}},"_links":{"self":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/bjjc\/4906","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/bjjc"}],"about":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/types\/bjjc"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/users\/1"}],"wp:attachment":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/media?parent=4906"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tags?post=4906"},{"taxonomy":"bjjc2nav","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/bjjc2nav?post=4906"},{"taxonomy":"tuisongtax","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tuisongtax?post=4906"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}