<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Guest Cookie and Comment Editing Duration - How-to and Troubleshooting				            </title>
            <link>https://wpdiscuz.com/community/troubleshooting/guest-cookie-and-comment-editing-duration/</link>
            <description>wpDiscuz WordPress Comment Plugin Community. Support and Resources.</description>
            <language>en-US</language>
            <lastBuildDate>Wed, 19 Aug 2026 09:21:56 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: Guest Cookie and Comment Editing Duration</title>
                        <link>https://wpdiscuz.com/community/troubleshooting/guest-cookie-and-comment-editing-duration/#post-26958</link>
                        <pubDate>Tue, 28 Jan 2025 23:00:50 +0000</pubDate>
                        <description><![CDATA[Even though it appears to be working properly, I wanted to add the snippets I applied here and show them to you as well. This way, I want to make sure I&#039;m not breaking anything.It sets the c...]]></description>
                        <content:encoded><![CDATA[<p>Even though it appears to be working properly, I wanted to add the snippets I applied here and show them to you as well. This way, I want to make sure I'm not breaking anything.<br /><br />It sets the cookies to 6 minutes. storeCommenterData doesn't accept minutes or hours so:<br /><br /></p>
<pre contenteditable="false">add_action('wp_print_footer_scripts', 'my_override_cookies_set', 9999);
function my_override_cookies_set() {
?&gt;
&lt;script&gt;
(function() {
if (typeof Cookies === 'undefined') {
return;
}

var originalCookiesSet = Cookies.set;

Cookies.set = function(name, value, options) {
if (name &amp;&amp; name.indexOf('comment_author_') &gt; -1) {
if (!options) {
options = {};
}
options.expires = 6 / (60 * 24);
}
return originalCookiesSet.call(this, name, value, options);
};
})();
&lt;/script&gt;
&lt;?php
}</pre>
<p><br /><br /><br />It reduces the comment editing time to 5 minutes:<br /><br /></p>
<pre contenteditable="false">add_filter('wpdiscuz_is_comment_editable', 'my_wpdiscuz_custom_edit_time', 10, 3);

function my_wpdiscuz_custom_edit_time($isCommentEditable, $comment, $editing_time = null) {
if (is_null($editing_time)) {
$editing_time = 5;
}

$editing_time = 5;

$comment_time_gmt = strtotime($comment-&gt;comment_date_gmt);
$now_gmt = current_time('timestamp', true);
$diff_in_minutes = ($now_gmt - $comment_time_gmt) / 60;

if ($diff_in_minutes &lt; $editing_time) {
return true;
} else {
return false;
}
}</pre>
<p><br /><br /><br />Just fyi: Apart from these, every time a comment is edited, the debug.log displays the following warning:</p>
<pre contenteditable="false">PHP Warning: Undefined array key "comment_agent" in /********/*********/public_html/wp/wp-includes/comment.php on line ...</pre>]]></content:encoded>
						                            <category domain="https://wpdiscuz.com/community/troubleshooting/">How-to and Troubleshooting</category>                        <dc:creator>Baboli</dc:creator>
                        <guid isPermaLink="true">https://wpdiscuz.com/community/troubleshooting/guest-cookie-and-comment-editing-duration/#post-26958</guid>
                    </item>
				                    <item>
                        <title>RE: Guest Cookie and Comment Editing Duration</title>
                        <link>https://wpdiscuz.com/community/troubleshooting/guest-cookie-and-comment-editing-duration/#post-26924</link>
                        <pubDate>Mon, 27 Jan 2025 11:21:31 +0000</pubDate>
                        <description><![CDATA[Hi,
You can use the wpdiscuz_is_comment_editable filter to control the comment editing time.
The cookie duration can be controlled using the wpdiscuz_js_options filter. Look for the storeC...]]></description>
                        <content:encoded><![CDATA[<p>Hi,</p>
<p>You can use the <a href="https://wpdiscuz.com/docs/codex/filters/wpdiscuz_is_comment_editable/" target="_blank" rel="noopener">wpdiscuz_is_comment_editable</a> filter to control the comment editing time.</p>
<p>The cookie duration can be controlled using the <a href="https://wpdiscuz.com/docs/codex/filters/wpdiscuz_js_options/" target="_blank" rel="noopener">wpdiscuz_js_options</a> filter. Look for the <em>storeCommenterData</em> key within the options.</p>]]></content:encoded>
						                            <category domain="https://wpdiscuz.com/community/troubleshooting/">How-to and Troubleshooting</category>                        <dc:creator>Asti</dc:creator>
                        <guid isPermaLink="true">https://wpdiscuz.com/community/troubleshooting/guest-cookie-and-comment-editing-duration/#post-26924</guid>
                    </item>
				                    <item>
                        <title>Guest Cookie and Comment Editing Duration</title>
                        <link>https://wpdiscuz.com/community/troubleshooting/guest-cookie-and-comment-editing-duration/#post-26910</link>
                        <pubDate>Sun, 26 Jan 2025 17:10:51 +0000</pubDate>
                        <description><![CDATA[Hi. Thanks again for this awesome plugin. In the plugin settings, we can set the cookie for guests to a minimum of 1 day. For comment editing, we can also set a minimum of 15 minutes. I want...]]></description>
                        <content:encoded><![CDATA[<p>Hi. Thanks again for this awesome plugin. In the plugin settings, we can set the cookie for guests to a minimum of 1 day. For comment editing, we can also set a minimum of 15 minutes. I want to change both of them. I want to reduce the comment editing time to 5 minutes and the cookie duration for guests to 6 minutes. How can I do this?</p>]]></content:encoded>
						                            <category domain="https://wpdiscuz.com/community/troubleshooting/">How-to and Troubleshooting</category>                        <dc:creator>Baboli</dc:creator>
                        <guid isPermaLink="true">https://wpdiscuz.com/community/troubleshooting/guest-cookie-and-comment-editing-duration/#post-26910</guid>
                    </item>
							        </channel>
        </rss>
		