{"id":3666,"date":"2025-06-12T02:41:49","date_gmt":"2025-06-11T18:41:49","guid":{"rendered":"https:\/\/www.zhaozhao123.cn\/wpcms\/wpdt\/3666.html"},"modified":"2025-06-12T02:41:49","modified_gmt":"2025-06-11T18:41:49","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8-wordpress-%e4%b8%ad%e5%85%81%e8%ae%b8%e7%94%a8%e6%88%b7%e8%ae%a2%e9%98%85%e8%af%84%e8%ae%ba","status":"publish","type":"post","link":"https:\/\/www.zhaozhao123.cn\/wpcms\/post\/3666.html","title":{"rendered":"\u5982\u4f55\u5728 WordPress \u4e2d\u5141\u8bb8\u7528\u6237\u8ba2\u9605\u8bc4\u8bba"},"content":{"rendered":"<div class=\"wp-block-columns p-0 border is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<div class=\"wp-block-columns px-4 py-3 border-bottom has-background is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\" style=\"background:linear-gradient(243deg,rgb(238,238,238) 0%,rgba(58,166,242,0.15) 100%)\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\r\n<figure class=\"wp-block-image size-thumbnail is-resized is-style-rounded is-style-rounded--1\"><img decoding=\"async\" src=\"https:\/\/www.zhaozhao123.cn\/myitems\/images\/sites16\/2025\/06\/dyA-1-400x300.jpg\" alt=\"Bug&#32534;&#35793;&#29422;\" class=\"wp-image-1842\" style=\"object-fit:cover;width:30px;height:30px\"><\/figure>\r\n\r\n\r\n\r\n<p class=\"my-0\">Bug&#32534;&#35793;&#29422;<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n\r\n\r\n<div class=\"wp-block-columns px-xl-5 px-4 py-xl-4 py-3 is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<p>&#22312; WordPress &#20013;&#20801;&#35768;&#29992;&#25143;&#35746;&#38405;&#35780;&#35770;&#26159;&#19968;&#31181;&#24120;&#35265;&#30340;&#21151;&#33021;&#35774;&#32622;&#65292;&#23427;&#21487;&#20197;&#35753;&#35780;&#35770;&#32773;&#36873;&#25321;&#26159;&#21542;&#25509;&#21463;&#37038;&#20214;&#36890;&#30693;&#26469;&#25509;&#25910;&#20182;&#20204;&#21457;&#34920;&#30340;&#35780;&#35770;&#12290;&#36825;&#31181;&#21151;&#33021;&#19981;&#20165;&#25552;&#39640;&#20102;&#29992;&#25143;&#30340;&#21442;&#19982;&#24230;&#21644;&#20114;&#21160;&#24615;&#65292;&#36824;&#33021;&#24110;&#21161;&#31649;&#29702;&#21592;&#26356;&#22909;&#22320;&#31649;&#29702;&#35780;&#35770;&#24182;&#21450;&#26102;&#22238;&#22797;&#37325;&#35201;&#38382;&#39064;&#12290;&#19979;&#38754;&#25105;&#23558;&#35814;&#32454;&#35828;&#26126;&#22914;&#20309;&#22312; WordPress &#20013;&#21551;&#29992;&#35780;&#35770;&#35746;&#38405;&#65292;&#24182;&#25552;&#20379;&#19968;&#20010;&#31616;&#21333;&#30340;&#31034;&#20363;&#20195;&#30721;&#12290;<\/p>\n<h3>&#27493;&#39588; 1: &#30331;&#24405;&#21040;&#24744;&#30340; WordPress &#31649;&#29702;&#21518;&#21488;<\/h3>\n<p>&#39318;&#20808;&#65292;&#30331;&#24405;&#21040;&#24744;&#30340; WordPress &#32593;&#31449;&#30340;&#31649;&#29702;&#21518;&#21488;&#65288;&#36890;&#24120;&#26159;&#36890;&#36807;&#27983;&#35272;&#22120;&#35775;&#38382; <code>http:\/\/yourdomain.com\/wp-admin\/<\/code>&#65289;&#12290;<\/p>\n<h3>&#27493;&#39588; 2: &#36827;&#20837;&ldquo;&#32534;&#36753;&rdquo;&#27169;&#24335;<\/h3>\n<p>&#28857;&#20987;&#21491;&#19978;&#35282;&#30340;&ldquo;&#33756;&#21333;&rdquo;&#65292;&#28982;&#21518;&#36873;&#25321;&ldquo;&#32534;&#36753;&rdquo;&#12290;<\/p>\n<h3>&#27493;&#39588; 3: &#25214;&#21040;&ldquo;&#35780;&#35770;&rdquo;&#36873;&#39033;<\/h3>\n<p>&#22312;&#24038;&#20391;&#33756;&#21333;&#26639;&#20013;&#25214;&#21040;&#24182;&#28857;&#20987;&ldquo;&#35780;&#35770;&rdquo;&#12290;<\/p>\n<h3>&#27493;&#39588; 4: &#21551;&#29992;&#35780;&#35770;&#35746;&#38405;<\/h3>\n<p>&#22312;&#35780;&#35770;&#35774;&#32622;&#39029;&#38754;&#65292;&#25214;&#21040;&ldquo;&#35746;&#38405;&#35780;&#35770;&rdquo;&#30340;&#36873;&#39033;&#21345;&#12290;&#22312;&#36825;&#37324;&#65292;&#24744;&#21487;&#20197;&#26597;&#30475;&#24403;&#21069;&#30340;&#35746;&#38405;&#29366;&#24577;&#20197;&#21450;&#30456;&#20851;&#30340;&#37197;&#32622;&#36873;&#39033;&#12290;<\/p>\n<ul>\n<li><strong>&#21551;&#29992;&#35746;&#38405;<\/strong>&#65306;&#22914;&#26524;&#24744;&#24076;&#26395;&#25152;&#26377;&#26032;&#35780;&#35770;&#37117;&#33258;&#21160;&#35746;&#38405;&#65292;&#35831;&#21246;&#36873;&ldquo;&#33258;&#21160;&#35746;&#38405;&#26032;&#35780;&#35770;&rdquo;&#12290;<\/li>\n<li><strong>&#21462;&#28040;&#35746;&#38405;<\/strong>&#65306;&#22914;&#26524;&#24744;&#24076;&#26395;&#29992;&#25143;&#21487;&#20197;&#36873;&#25321;&#26159;&#21542;&#35746;&#38405;&#35780;&#35770;&#65292;&#21017;&#24212;&#21462;&#28040;&#21246;&#36873;&ldquo;&#33258;&#21160;&#35746;&#38405;&#26032;&#35780;&#35770;&rdquo;&#12290;<\/li>\n<li><strong>&#26356;&#25913;&#40664;&#35748;&#35774;&#32622;<\/strong>&#65306;&#22914;&#26524;&#24819;&#35201;&#25913;&#21464;&#40664;&#35748;&#30340;&#35746;&#38405;&#34892;&#20026;&#65292;&#21487;&#20197;&#22312;&ldquo;&#33258;&#23450;&#20041;&rdquo;&#37096;&#20998;&#36827;&#34892;&#35843;&#25972;&#12290;<\/li>\n<\/ul>\n<h3>&#31034;&#20363;&#20195;&#30721;&#65306;<\/h3>\n<p>&#20551;&#35774;&#24744;&#24050;&#32463;&#21551;&#29992;&#20102;&ldquo;&#33258;&#21160;&#35746;&#38405;&#26032;&#35780;&#35770;&rdquo;&#65292;&#37027;&#20040;&#24403;&#26377;&#20154;&#21457;&#24067;&#26032;&#30340;&#35780;&#35770;&#26102;&#65292;&#31995;&#32479;&#20250;&#33258;&#21160;&#21521;&#20182;&#20204;&#30340;&#30005;&#23376;&#37038;&#20214;&#22320;&#22336;&#21457;&#36865;&#19968;&#23553;&#30830;&#35748;&#37038;&#20214;&#65292;&#35810;&#38382;&#20182;&#20204;&#26159;&#21542;&#21516;&#24847;&#25509;&#25910;&#35780;&#35770;&#26356;&#26032;&#36890;&#30693;&#12290;<\/p>\n<pre><code class=\"language-php\">\/\/ &#23450;&#20041;&#21464;&#37327;\n$commenter = wp_get_current_commenter();\n$user_id = $commenter['user_id'];\n$email = $commenter['email_address'];\n\n\/\/ &#21457;&#36865;&#35746;&#38405;&#30830;&#35748;&#37038;&#20214;\nfunction send_subscribe_confirmation_email($subject, $message) {\n    \/\/ &#35774;&#32622;&#37038;&#20214;&#21442;&#25968;\n    $to = $email;\n    $from = 'your-email@example.com';\n    $headers = \"From: \" . $from . \"rn\";\n\n    \/\/ &#26816;&#26597;&#26159;&#21542;&#24050;&#35746;&#38405;\n    if (!get_option('autoapprove')) {\n        $confirmation_link = add_query_arg(array(\n            'action' =&gt; 'subscribe',\n            'user_id' =&gt; $user_id,\n        ), admin_url('\/comments.php'));\n\n        \/\/ &#26500;&#24314;&#37038;&#20214;&#27491;&#25991;\n        $body = '&lt;html&gt;\n                  &lt;head&gt;\n                    &lt;title&gt;' . esc_html__( 'Subscribe Confirmation', 'text_domain' ) . '&lt;\/title&gt;\n                  &lt;\/head&gt;\n                  &lt;body style=\"font-family: Arial; color: #333;\"&gt;\n                    &lt;h1&gt;' . esc_html__( 'Thank you for subscribing!', 'text_domain' ) . '&lt;\/h1&gt;\n                    &lt;p&gt;' . esc_html__( 'You have successfully subscribed to our newsletter.', 'text_domain' ) . '&lt;\/p&gt;\n                    &lt;p&gt;&lt;a href=\"' . esc_url( $confirmation_link ) . '\"&gt;' . esc_html__( 'View your subscription details here', 'text_domain' ) . '&lt;\/a&gt;&lt;\/p&gt;\n                  &lt;\/body&gt;\n                &lt;\/html&gt;';\n\n        \/\/ &#21457;&#36865;&#37038;&#20214;\n        wp_mail($to, $subject, $body, $headers);\n    }\n}<\/code><\/pre>\n<h3>&#20351;&#29992;&#27493;&#39588;&#21450;&#25928;&#26524;&#65306;<\/h3>\n<ol>\n<li><strong>&#21551;&#29992;&#33258;&#21160;&#35746;&#38405;<\/strong>&#65306;&#30830;&#20445;&#22312;&#35780;&#35770;&#35774;&#32622;&#20013;&#24320;&#21551;&#20102;&ldquo;&#33258;&#21160;&#35746;&#38405;&#26032;&#35780;&#35770;&rdquo;&#12290;<\/li>\n<li><strong>&#21457;&#36865;&#30830;&#35748;&#37038;&#20214;<\/strong>&#65306;&#24403;&#26377;&#26032;&#35780;&#35770;&#26102;&#65292;&#31995;&#32479;&#20250;&#26816;&#26597;&#26159;&#21542;&#26377;&#26410;&#34987;&#35746;&#38405;&#30340;&#35780;&#35770;&#12290;&#22914;&#26524;&#26377;&#65292;&#23601;&#20250;&#21457;&#36865;&#19968;&#23553;&#30830;&#35748;&#37038;&#20214;&#32473;&#35780;&#35770;&#32773;&#12290;<\/li>\n<li><strong>&#29992;&#25143;&#21453;&#39304;<\/strong>&#65306;&#35780;&#35770;&#32773;&#25910;&#21040;&#30830;&#35748;&#37038;&#20214;&#21518;&#65292;&#21487;&#20197;&#26597;&#30475;&#37038;&#20214;&#20013;&#30340;&#38142;&#25509;&#20197;&#28608;&#27963;&#35746;&#38405;&#12290;<\/li>\n<\/ol>\n<p>&#36825;&#21482;&#26159;&#19968;&#20010;&#22522;&#26412;&#30340;&#31034;&#20363;&#65292;&#23454;&#38469;&#24212;&#29992;&#20013;&#21487;&#33021;&#38656;&#35201;&#26681;&#25454;&#20855;&#20307;&#38656;&#27714;&#36827;&#19968;&#27493;&#23450;&#21046;&#37038;&#20214;&#27169;&#26495;&#21644;&#21151;&#33021;&#23454;&#29616;&#12290;<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div><div class=\"wp-block-columns p-0 border is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<div class=\"wp-block-columns px-4 py-3 border-bottom has-background is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\" style=\"background:linear-gradient(243deg,rgb(238,238,238) 0%,rgba(58,166,242,0.15) 100%)\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\r\n<figure class=\"wp-block-image size-thumbnail is-resized is-style-rounded is-style-rounded--2\"><img decoding=\"async\" src=\"https:\/\/www.zhaozhao123.cn\/myitems\/images\/sites16\/2025\/06\/zp-400x300.jpg\" alt=\"&#40657;&#26495;&#21069;&#30340;Bug&#35821;&#27861;&#35762;&#24072;\" class=\"wp-image-1849\" style=\"object-fit:cover;width:30px;height:30px\"><\/figure>\r\n\r\n\r\n\r\n<p class=\"my-0\">&#40657;&#26495;&#21069;&#30340;Bug&#35821;&#27861;&#35762;&#24072;<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n\r\n\r\n<div class=\"wp-block-columns px-xl-5 px-4 py-xl-4 py-3 is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<h3>&#35762;&#35299;&#30446;&#26631;&#65306;<\/h3>\n<p>&#26412;&#35838;&#31243;&#23558;&#25945;&#25480;&#24744;&#22914;&#20309;&#22312;WordPress&#32593;&#31449;&#19978;&#35774;&#32622;&#35780;&#35770;&#35746;&#38405;&#21151;&#33021;&#65292;&#20351;&#24744;&#30340;&#31449;&#28857;&#26356;&#21152;&#20114;&#21160;&#21644;&#20010;&#24615;&#21270;&#12290;<\/p>\n<h3>&#25945;&#23398;&#22823;&#32434;&#65306;<\/h3>\n<ol>\n<li><strong>&#20102;&#35299;&#35780;&#35770;&#35746;&#38405;<\/strong><\/li>\n<li><strong>&#21019;&#24314;&#24182;&#37197;&#32622;&#35780;&#35770;&#34920;&#21333;<\/strong><\/li>\n<li><strong>&#20351;&#29992;WordPress&#25554;&#20214;&#23454;&#29616;&#33258;&#21160;&#22238;&#22797;<\/strong><\/li>\n<li><strong>&#35774;&#32622;&#35780;&#35770;&#26684;&#24335;<\/strong><\/li>\n<\/ol>\n<h3>&#31532;&#19968;&#27493;&#65306;&#20102;&#35299;&#35780;&#35770;&#35746;&#38405;<\/h3>\n<p>&#39318;&#20808;&#65292;&#25105;&#20204;&#38656;&#35201;&#29702;&#35299;&#35780;&#35770;&#35746;&#38405;&#30340;&#27010;&#24565;&#12290;&#35780;&#35770;&#35746;&#38405;&#26159;&#19968;&#31181;&#35753;&#29992;&#25143;&#36873;&#25321;&#26159;&#21542;&#25910;&#21040;&#26032;&#30340;&#35780;&#35770;&#36890;&#30693;&#30340;&#26041;&#24335;&#12290;&#36825;&#21487;&#20197;&#36890;&#36807;&#22312;WordPress&#20027;&#39064;&#25110;&#25554;&#20214;&#20013;&#35774;&#32622;&#26469;&#23454;&#29616;&#12290;<\/p>\n<h4>&#31034;&#20363;&#20195;&#30721;&#65306;<\/h4>\n<pre><code class=\"language-html\">&lt;?php\n\/**\n * Plugin Name: Comment Subscription\n * Description: Automatically subscribe users to comments.\n *\/\n\n\/\/ Register the comment subscription form.\nadd_action( 'comment_form', 'my_comment_form' );\n\nfunction my_comment_form() {\n  ?&gt;\n  &lt;div class=\"subscribe\"&gt;\n    &lt;form action=\"\" method=\"post\" id=\"comment-subscribe-form\"&gt;\n      &lt;label for=\"email\"&gt;Subscribe by email:&lt;\/label&gt;\n      &lt;input type=\"email\" name=\"email\" id=\"email\" \/&gt;\n      &lt;button type=\"submit\" class=\"subscribe-button\"&gt;Subscribe&lt;\/button&gt;\n    &lt;\/form&gt;\n  &lt;\/div&gt;\n  &lt;?php\n}<\/code><\/pre>\n<h4>&#35299;&#37322;&#65306;<\/h4>\n<ul>\n<li><code>add_action( 'comment_form', 'my_comment_form' );<\/code> &#36825;&#34892;&#20195;&#30721;&#23450;&#20041;&#20102;&#19968;&#20010;&#20989;&#25968;&#65292;&#24403;&#29992;&#25143;&#25552;&#20132;&#35780;&#35770;&#26102;&#65292;&#20250;&#35843;&#29992;&#36825;&#20010;&#20989;&#25968;&#12290;<\/li>\n<li>&#22312; <code>my_comment_form()<\/code> &#20989;&#25968;&#20013;&#65292;&#25105;&#20204;&#35774;&#32622;&#20102;HTML&#32467;&#26500;&#65292;&#21253;&#25324;&#19968;&#20010;&#34920;&#21333;&#65292;&#29992;&#20110;&#36755;&#20837;&#29992;&#25143;&#30340;&#30005;&#23376;&#37038;&#20214;&#22320;&#22336;&#12290;<\/li>\n<\/ul>\n<h3>&#31532;&#20108;&#27493;&#65306;&#21019;&#24314;&#24182;&#37197;&#32622;&#35780;&#35770;&#34920;&#21333;<\/h3>\n<p>&#25509;&#19979;&#26469;&#65292;&#25105;&#20204;&#23558;&#22312;WordPress&#20013;&#21019;&#24314;&#19968;&#20010;&#34920;&#21333;&#65292;&#20197;&#20415;&#29992;&#25143;&#21487;&#20197;&#35746;&#38405;&#35780;&#35770;&#12290;&#27492;&#27493;&#39588;&#38656;&#35201;&#19968;&#20123;&#22522;&#30784;&#30340;HTML&#30693;&#35782;&#12290;<\/p>\n<h4>&#31034;&#20363;&#20195;&#30721;&#65306;<\/h4>\n<pre><code class=\"language-html\">&lt;!-- &#22312;&#20027;&#39064;&#25991;&#20214;&#22841;&#19979;&#30340;wp-content\/plugins&#30446;&#24405;&#19979;&#21019;&#24314;&#19968;&#20010;&#21517;&#20026;CommentSubscription.php&#30340;&#25991;&#20214; --&gt;\n&lt;?php\nclass CommentSubscription extends WP_Widget {\n\n    public function __construct() {\n        parent::__construct(\n            'comment_subscription',\n            'Comment Subscription',\n            array('description' =&gt; __( 'Automatically subscribe users to comments.' ))\n        );\n    }\n\n    public function widget($args, $instance) {\n        extract($args);\n        echo $before_widget;\n        if ( ! empty( $instance['email'] ) ) {\n            printf( $before_title . esc_html( $instance['title'] ) . $after_title, esc_html( get_bloginfo( 'name' ) ), esc_html( $instance['email'] ) );\n        }\n        $output = '';\n        $output .= '&lt;p&gt;&lt;strong&gt;Email Subscriptions:&lt;\/strong&gt;';\n        $output .= '&lt;ul&gt;';\n        foreach ( $instance as $key =&gt; $value ) {\n            $output .= \"&lt;li&gt;\" . $key . \": \" . esc_attr( $value ) . \"&lt;\/li&gt;\";\n        }\n        $output .= '&lt;\/ul&gt;&lt;\/p&gt;';\n        echo $before_content;\n        do_action( 'comment_subscribed', $instance['email'] );\n        echo $after_content;\n        echo $after_widget;\n    }\n\n    public function update( $new_instance, $old_instance ) {\n        $instance = wp_parse_args( $new_instance, $old_instance );\n        return $instance;\n    }\n\n    public function form( $instance ) {\n        $defaults = array(\n            'email' =&gt; ''\n        );\n        $instance = wp_parse_args( (array) $instance, $defaults );\n        $options = get_option( 'comment_subscription_options' );\n        if (!empty( $options[$instance['email']] )) {\n            echo \"&lt;p&gt;Sorry, this user has already been subscribed.&lt;\/p&gt;\";\n            exit();\n        }\n        $output = \"\";\n        $output .= \"&lt;label for='email'&gt;Email Address:&lt;\/label&gt;\";\n        $output .= \"&lt;input type='email' name='email' id='email' value='\" . esc_attr( $instance['email'] ) . \"' \/&gt;\";\n        $output .= \"&lt;p&gt;&lt;input type='checkbox' name='save_email' value='1' \".checked( true, $instance['email'], false ).\"&gt; Save me on future posts&lt;\/p&gt;\";\n        echo $output;\n    }\n\n    public function widget_text() {\n        echo $this-&gt;get_title();\n    }\n\n}\n\nif ( ! defined( 'ABSPATH' ) ) {\n    exit; \/\/ Exit if accessed directly.\n} \n\nregister_widget( 'CommentSubscription' );<\/code><\/pre>\n<h4>&#35299;&#37322;&#65306;<\/h4>\n<ul>\n<li>&#21019;&#24314;&#19968;&#20010;&#26032;&#30340;&#31867;&#65288;&#22914; <code>CommentSubscription<\/code>&#65289;&#65292;&#32487;&#25215;&#33258; <code>WP_Widget<\/code>&#12290;<\/li>\n<li>&#35774;&#32622;&#19968;&#20010;&#25551;&#36848;&#25991;&#26412;&#12290;<\/li>\n<li>&#28155;&#21152;&#19968;&#20010;&#26041;&#27861; <code>widget<\/code> &#26469;&#22788;&#29702;&#29992;&#25143;&#25552;&#20132;&#30340;&#35780;&#35770;&#34920;&#21333;&#12290;<\/li>\n<li>&#22312; <code>widget<\/code> &#26041;&#27861;&#20013;&#65292;&#36755;&#20986;&#26631;&#39064;&#12289;&#30005;&#23376;&#37038;&#20214;&#22320;&#22336;&#31561;&#20449;&#24687;&#12290;<\/li>\n<li>&#25552;&#20379;&#26356;&#26032;&#23454;&#20363;&#30340;&#26041;&#27861; <code>update<\/code> &#21644;&#26356;&#26032;&#34920;&#21333;&#30340;&#31034;&#20363; <code>form<\/code> &#26041;&#27861;&#12290;<\/li>\n<li>&#23450;&#20041;&#19968;&#20010;&#26041;&#27861; <code>widget_text<\/code> &#26469;&#26174;&#31034;&#26631;&#39064;&#12290;<\/li>\n<\/ul>\n<h3>&#31532;&#19977;&#27493;&#65306;&#20351;&#29992;WordPress&#25554;&#20214;&#23454;&#29616;&#33258;&#21160;&#22238;&#22797;<\/h3>\n<p>&#20026;&#20102;&#31616;&#21270;&#35780;&#35770;&#27969;&#31243;&#65292;&#24744;&#21487;&#20197;&#32771;&#34385;&#20351;&#29992;WordPress&#25554;&#20214;&#26469;&#25552;&#20379;&#33258;&#21160;&#22238;&#22797;&#21151;&#33021;&#12290;&#36825;&#20123;&#25554;&#20214;&#36890;&#24120;&#21253;&#21547;&#33258;&#21160;&#22238;&#22797;&#30340;&#27169;&#26495;&#65292;&#21487;&#20197;&#24110;&#21161;&#20943;&#23569;&#24037;&#20316;&#37327;&#12290;<\/p>\n<h4>&#31034;&#20363;&#20195;&#30721;&#65306;<\/h4>\n<pre><code class=\"language-xml\">&lt;plugin&gt;\n  &lt;name&gt;AutoReply&lt;\/name&gt;\n  &lt;author&gt;Email Notifications&lt;\/author&gt;\n  &lt;author_url&gt;https:\/\/example.com&lt;\/author_url&gt;\n  &lt;icon&gt;fa fa-comment&lt;\/icon&gt;\n  &lt;version&gt;1.0&lt;\/version&gt;\n  &lt;description&gt;This plugin allows you to automatically reply to all comments with a custom message.&lt;\/description&gt;\n\n  &lt;requirements&gt;\n    &lt;theme&gt;WordPress Theme&lt;\/theme&gt;\n  &lt;\/requirements&gt;\n\n  &lt;description&gt;This plugin allows you to automatically reply to all comments with a custom message.&lt;\/description&gt;\n  &lt;script&gt;\n    function initPlugin() {\n      const postType = wp.vocabs.getByName(\"comment\");\n      const autoReplyMessage = wp.vocabs.getByName(\"auto-reply-message\");\n\n      \/\/ Set up the plugin's settings and hooks here.\n\n      \/\/ Initialize the auto-reply feature.\n      wp.vocabs.register( \"auto-reply-message\", {\n        name: \"Auto Reply Message\",\n        singularName: \"Auto Reply Message\",\n        path: \"\/auto-reply-message\/\",\n        label: \"Auto Reply Message\",\n        context: \"all\",\n        count: 5,\n        description: \"This is an example of a custom message.\",\n        category: \"Custom Messages\",\n        status: \"publish\"\n      });\n\n      \/\/ Add a new comment hook to handle auto-reply functionality.\n      wp.add_filter( 'comments_post_link', 'add_auto_reply_to_comments_link', 9999, 2 );\n\n      \/\/ Add a filter to allow for dynamic content in the reply area.\n      wp.customize( 'reply_area', function( editor ) {\n        editor.setEditorValue(`\n          &lt;h3&gt;Example Auto-Reply&lt;\/h3&gt;\n          &lt;p&gt;This is an example of how to use the auto-reply feature. You can customize the message using the following shortcode:&lt;\/p&gt;\n          &lt;pre&gt;\n            {{ auto-reply_message }}\n          &lt;\/pre&gt;\n        `);\n      } );\n    }\n\n    function add_auto_reply_to_comments_link( $link ) {\n      $link .= '\/?auto-reply=on';\n      return $link;\n    }\n\n    function auto_reply_on_page() {\n      global $post;\n\n      \/\/ Check if the post is a comment post.\n      if ( is_comment_post() ) {\n        \/\/ Get the current comment object.\n        $comment = get_comment();\n\n        \/\/ If there's no comment object, bail out early.\n        if ( ! $comment ) {\n          return;\n        }\n\n        \/\/ Get the current post ID.\n        $current_post_id = $post-&gt;ID;\n\n        \/\/ Check if the comment was submitted via the comment form.\n        if ( isset($_POST['comment']) &amp;&amp; $_POST['comment'] == $comment-&gt;comment_ID ) {\n          \/\/ Get the auto-reply message from the custom messages table.\n          $message = wp_vocabulary_get_by_name('auto-reply-message');\n\n          \/\/ Format the message and replace placeholders.\n          $formatted_message = str_replace('{post_title}', $post-&gt;post_title, $message-&gt;singularName);\n\n          \/\/ Insert the formatted message into the reply area.\n          $post_content = wpautop( strip_shortcodes( $comment-&gt;comment_content ) );\n          $post_content = preg_replace('\/{{ auto-reply-message }}\/', $formatted_message, $post_content);\n          $post_content = apply_filters('the_content', $post_content);\n\n          \/\/ Update the comment content with the formatted message.\n          update_comment_meta( $comment-&gt;comment_ID, 'comment_content', $post_content );\n        }\n      }\n    }\n  &lt;\/script&gt;\n&lt;\/plugin&gt;<\/code><\/pre>\n<h4>&#35299;&#37322;&#65306;<\/h4>\n<ul>\n<li>&#20351;&#29992; <code>wp_vocabs<\/code> &#25552;&#20379;&#20102;&#33258;&#21160;&#22238;&#22797;&#28040;&#24687;&#30340;&#31867;&#21035;&#31649;&#29702;&#12290;<\/li>\n<li>&#28155;&#21152;&#33258;&#21160;&#22238;&#22797;&#21040;&#35780;&#35770;&#39029;&#38754;&#30340;&#21151;&#33021;&#12290;<\/li>\n<li>&#33258;&#21160;&#22238;&#22797;&#28040;&#24687;&#36890;&#36807;&#23450;&#21046;&#21270;&#30340;&#20869;&#23481;&#21306;&#22495;&#23637;&#31034;&#12290;<\/li>\n<\/ul>\n<h3>&#31532;&#22235;&#27493;&#65306;&#35774;&#32622;&#35780;&#35770;&#26684;&#24335;<\/h3>\n<p>&#26368;&#21518;&#65292;&#20026;&#29992;&#25143;&#25552;&#20379;&#19968;&#31181;&#26041;&#20415;&#30340;&#26041;&#24335;&#26469;&#26597;&#30475;&#21644;&#31649;&#29702;&#20182;&#20204;&#30340;&#35780;&#35770;&#12290;&#36825;&#36890;&#24120;&#28041;&#21450;&#22312;WordPress&#20027;&#39064;&#25110;&#25554;&#20214;&#20013;&#28155;&#21152;&#29305;&#23450;&#30340;&#26679;&#24335;&#35268;&#21017;&#25110;&#21151;&#33021;&#12290;<\/p>\n<h4>&#31034;&#20363;&#20195;&#30721;&#65306;<\/h4>\n<pre><code class=\"language-css\">\/* &#22312;&#20027;&#39064;&#25991;&#20214;&#22841;&#19979;&#30340;wp-content\/themes\/your-theme\/css&#30446;&#24405;&#19979;&#21019;&#24314;&#19968;&#20010;&#21517;&#20026;custom.css&#30340;&#25991;&#20214; *\/\nbody.comment-list {\n  font-family: Arial, sans-serif;\n  font-size: 16px;\n  color: #333;\n  background-color: #fff;\n  padding: 20px;\n  margin: 0;\n  -webkit-column-count: 3;\n  column-count: 3;\n}\n\n.post {\n  display: inline-block;\n  width: calc((100% \/ 3) - 8px);\n}\n\n.comment {\n  margin-bottom: 10px;\n}\n\n.reply {\n  text-align: right;\n  padding-right: 10px;\n}\n\n.author {\n  margin-top: 5px;\n}\n\n.date {\n  margin-top: 5px;\n}\n\n.reply a {\n  color: #333;\n  cursor: pointer;\n}\n\n.reply a:hover {\n  text-decoration: underline;\n}\n\n.reply a span {\n  cursor: pointer;\n}<\/code><\/pre>\n<h4>&#35299;&#37322;&#65306;<\/h4>\n<ul>\n<li>&#26679;&#24335;&#35268;&#21017;&#24212;&#29992;&#20110;&#20855;&#26377; <code>comment-list<\/code> &#31867;&#30340;&#39029;&#38754;&#20803;&#32032;&#65292;&#20197;&#35843;&#25972;&#21015;&#34920;&#24067;&#23616;&#12290;<\/li>\n<li>&#26681;&#25454;&#35780;&#35770;&#31867;&#22411;&#65288;&#22914;&#20316;&#32773;&#12289;&#26085;&#26399;&#31561;&#65289;&#35774;&#32622;&#19981;&#21516;&#30340;&#26679;&#24335;&#23646;&#24615;&#12290;<\/li>\n<\/ul>\n<h3>&#24635;&#32467;<\/h3>\n<p>&#36890;&#36807;&#20197;&#19978;&#27493;&#39588;&#65292;&#24744;&#24050;&#32463;&#25104;&#21151;&#22320;&#23454;&#29616;&#20102;&#35780;&#35770;&#35746;&#38405;&#12289;&#33258;&#21160;&#22238;&#22797;&#20197;&#21450;&#35780;&#35770;&#26684;&#24335;&#30340;&#35774;&#32622;&#12290;&#36825;&#26679;&#65292;&#26080;&#35770;&#29992;&#25143;&#20309;&#26102;&#35775;&#38382;&#24744;&#30340;&#32593;&#31449;&#65292;&#37117;&#21487;&#20197;&#36731;&#26494;&#25509;&#25910;&#26032;&#35780;&#35770;&#30340;&#36890;&#30693;&#65292;&#24182;&#20139;&#21463;&#20010;&#24615;&#21270;&#30340;&#29992;&#25143;&#20307;&#39564;&#12290;<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Bug&#32534;&#35793;&#29422; &#22312; WordPress &#20013;&#20801;&#35768;&#29992;&#25143;&#35746;&#38405;&#35780;&#35770;&#26159;&#19968;&#31181;&#24120;&#35265;&#038;..<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[2107,2106],"tuisongtax":[],"class_list":["post-3666","post","type-post","status-publish","format-standard","hentry","category-wpdt","tag-cjyy","tag-cjzn"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts\/3666","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/comments?post=3666"}],"version-history":[{"count":0,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts\/3666\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/media?parent=3666"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/categories?post=3666"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tags?post=3666"},{"taxonomy":"tuisongtax","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tuisongtax?post=3666"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}