<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>WordPress on 背字根</title><link>https://www.beizigen.com/tag/wordpress/</link><description>Recent content in WordPress on 背字根</description><generator>Hugo</generator><language>zh-CN</language><copyright>2016</copyright><lastBuildDate>Fri, 27 Feb 2026 09:18:51 +0800</lastBuildDate><atom:link href="https://www.beizigen.com/tag/wordpress/index.xml" rel="self" type="application/rss+xml"/><item><title>WordPress添加新评论函数：wp_new_comment</title><link>https://www.beizigen.com/post/wordpress-function-wp_new_comment/</link><pubDate>Fri, 27 Feb 2026 09:18:51 +0800</pubDate><guid>https://www.beizigen.com/post/wordpress-function-wp_new_comment/</guid><description>&lt;p&gt;WordPress函数wp_new_comment()向数据库添加新评论。该函数接受一个包含评论数据的数组和一个可选的布尔值参数，用于指定在发生错误时是否返回WP_Error对象。成功时返回评论的ID，失败时返回false或WP_Error对象。&lt;/p&gt;</description></item><item><title>WordPress检测洪水评论函数：wp_throttle_comment_flood</title><link>https://www.beizigen.com/post/wordpress-function-wp_throttle_comment_flood/</link><pubDate>Thu, 26 Feb 2026 20:53:19 +0800</pubDate><guid>https://www.beizigen.com/post/wordpress-function-wp_throttle_comment_flood/</guid><description>&lt;p&gt;WordPress函数wp_throttle_comment_flood()检测是否存在刷评论。该函数通过比较最后一条评论的时间戳和新评论的时间戳，判断时间差是否小于15秒，以防止评论泛滥。&lt;/p&gt;</description></item><item><title>WordPress过滤评论数据函数：wp_filter_comment</title><link>https://www.beizigen.com/post/wordpress-function-wp_filter_comment/</link><pubDate>Mon, 01 Dec 2025 10:30:55 +0800</pubDate><guid>https://www.beizigen.com/post/wordpress-function-wp_filter_comment/</guid><description>&lt;p&gt;WordPress函数wp_filter_comment()过滤和净化评论数据。&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;wp_filter_comment( array $commentdata ): array
&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;函数参数&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;$commentdata&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;数据类型：array (必须)&lt;/p&gt;
&lt;p&gt;包含有关评论的信息。参考：&lt;a href="https://www.beizigen.com/post/wordpress-function-wp_insert_comment/"&gt;WordPress在数据库插入评论函数：wp_insert_comment&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;函数返回值&lt;/h2&gt;&lt;p&gt;wp_filter_comment()函数返回过滤处理后的评论信息。&lt;/p&gt;</description></item><item><title>WordPress在数据库插入评论函数：wp_insert_comment</title><link>https://www.beizigen.com/post/wordpress-function-wp_insert_comment/</link><pubDate>Sun, 30 Nov 2025 09:56:18 +0800</pubDate><guid>https://www.beizigen.com/post/wordpress-function-wp_insert_comment/</guid><description>&lt;p&gt;WordPress函数wp_insert_comment()在数据库中插入评论。&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;wp_insert_comment( array $commentdata ): int|false
&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;函数参数&lt;/h2&gt;&lt;h3&gt;$commentdata&lt;/h3&gt;&lt;p&gt;数据类型：array (必须)&lt;/p&gt;
&lt;p&gt;用于插入新评论的参数数组。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;comment_agent&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;数据类型：string&lt;/p&gt;</description></item><item><title>WordPress获取当前评论者信息函数：wp_get_current_commenter</title><link>https://www.beizigen.com/post/wordpress-function-wp_get_current_commenter/</link><pubDate>Wed, 29 Oct 2025 09:19:25 +0800</pubDate><guid>https://www.beizigen.com/post/wordpress-function-wp_get_current_commenter/</guid><description>&lt;p&gt;WordPress函数wp_get_current_commenter()用于获取当前评论者的姓名、电子邮件和URL，该函数没有参数。&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;wp_get_current_commenter(): array
&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;函数返回值&lt;/h2&gt;&lt;p&gt;当前评论者信息的数组：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;comment_author：当前评论者的名称；&lt;/p&gt;</description></item><item><title>WordPress查询评论状态函数：wp_get_comment_status</title><link>https://www.beizigen.com/post/wordpress-function-wp_get_comment_status/</link><pubDate>Thu, 23 Oct 2025 10:20:18 +0800</pubDate><guid>https://www.beizigen.com/post/wordpress-function-wp_get_comment_status/</guid><description>&lt;p&gt;WordPress函数wp_get_comment_status()根据评论ID查询该评论的状态。&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;wp_get_comment_status( int|WP_Comment $comment_id ): string|false
&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;函数参数&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;$comment_id&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;数据类型：int|WP_Comment (必须)&lt;/p&gt;
&lt;p&gt;评论ID或WP_Comment对象&lt;/p&gt;</description></item><item><title>WordPress删除评论函数：wp_delete_comment</title><link>https://www.beizigen.com/post/wordpress-function-wp_delete_comment/</link><pubDate>Thu, 23 Oct 2025 10:04:38 +0800</pubDate><guid>https://www.beizigen.com/post/wordpress-function-wp_delete_comment/</guid><description>&lt;p&gt;WordPress函数wp_delete_comment()用于删除评论。一般情况下，wp_delete_comment()函数会将评论移入回收站，而不是永久删除。如果已禁用回收站，或评论本身已在回收站中，或参数$force_delete为true，则评论将被永久删除。&lt;/p&gt;</description></item><item><title>WordPress验证评论数据是否被允许函数：wp_allow_comment</title><link>https://www.beizigen.com/post/wordpress-function-wp_allow_comment/</link><pubDate>Wed, 22 Oct 2025 09:13:57 +0800</pubDate><guid>https://www.beizigen.com/post/wordpress-function-wp_allow_comment/</guid><description>&lt;p&gt;WordPress函数wp_allow_comment()用于验证评论数据是否被允许。该函数首先验证评论是否重复发布，最后使用函数wp_check_comment_data()检测并返回结果。验证的数据如：&lt;/p&gt;</description></item><item><title>WordPress安全验证和清理评论Cookie函数：sanitize_comment_cookies</title><link>https://www.beizigen.com/post/wordpress-function-sanitize_comment_cookies/</link><pubDate>Wed, 27 Aug 2025 19:59:16 +0800</pubDate><guid>https://www.beizigen.com/post/wordpress-function-sanitize_comment_cookies/</guid><description>&lt;p&gt;当你在一个WordPress网站的评论框里留言时，通常会有一个选项让你保存我的姓名、邮箱和网址在浏览器中，以便下次评论时使用。&lt;/p&gt;
&lt;p&gt;如果你勾选了此选项，WordPress会在你的浏览器中设置三个Cookie：&lt;/p&gt;</description></item><item><title>WordPress返回最后一条评论修改时间函数：get_lastcommentmodified</title><link>https://www.beizigen.com/post/wordpress-function-get_lastcommentmodified/</link><pubDate>Wed, 30 Oct 2024 09:30:23 +0800</pubDate><guid>https://www.beizigen.com/post/wordpress-function-get_lastcommentmodified/</guid><description>&lt;p&gt;WordPress函数get_lastcommentmodified用于返回最后一条评论的修改时间。&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;get_lastcommentmodified( string $timezone = &amp;#39;server&amp;#39; ): string|false
&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;函数参数&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;$timezone&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;字符串，默认值：server&lt;/p&gt;
&lt;p&gt;可用值：gmt、blog、server&lt;/p&gt;</description></item></channel></rss>