<?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>
									How to add wpdiscuz_votes_separate when adding new comment - How-to and Troubleshooting				            </title>
            <link>https://wpdiscuz.com/community/troubleshooting/how-to-add-wpdiscuz_votes_separate-when-adding-new-comment/</link>
            <description>wpDiscuz WordPress Comment Plugin Community. Support and Resources.</description>
            <language>en-US</language>
            <lastBuildDate>Wed, 16 Sep 2026 06:18:33 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: How to add wpdiscuz_votes_separate when adding new comment</title>
                        <link>https://wpdiscuz.com/community/troubleshooting/how-to-add-wpdiscuz_votes_separate-when-adding-new-comment/#post-13098</link>
                        <pubDate>Wed, 26 Jan 2022 11:42:40 +0000</pubDate>
                        <description><![CDATA[The solution that I came up with if there is no wpdiscuz_votes_seperate and wp_discuz_votes in the commentmeta table after the comment is added on the website and I try to like or dislike th...]]></description>
                        <content:encoded><![CDATA[<p>The solution that I came up with if there is no <em>wpdiscuz_votes_seperate</em> and <em>wp_discuz_votes</em> in the <strong>commentmeta</strong> table after the comment is added on the website and I try to like or dislike the comment on my <strong>mobile app</strong>:</p>
<p>When I try to select those fields from the <strong>commentmeta</strong> like I did here: https://wpdiscuz.com/community/postid/13043/</p>
<p>And the select returns nothing because there are no fields with those names I use the <em>add_comment_meta</em> instead of updating the database. Like this:</p>
<pre contenteditable="false">$result = $wpdb-&gt;get_results( "SELECT meta_value FROM $wpdb-&gt;commentmeta WHERE comment_id = $commentId AND meta_key = 'wpdiscuz_votes_seperate'");
$meta = $result-&gt;{'meta_value'};
    
if($meta == ""){
    if(strcmp($voteType, 'like') === 0) {
        add_comment_meta($commentId, 'wpdiscuz_votes_seperate', );
        add_comment_meta($commentId, 'wpdiscuz_votes', 1);
    }
    else {
        add_comment_meta($commentId, 'wpdiscuz_votes_seperate', );
        add_comment_meta($commentId, 'wpdiscuz_votes', -1);
    }
}</pre>
<p>Hope this helps anyone.</p>]]></content:encoded>
						                            <category domain="https://wpdiscuz.com/community/troubleshooting/">How-to and Troubleshooting</category>                        <dc:creator>stevara</dc:creator>
                        <guid isPermaLink="true">https://wpdiscuz.com/community/troubleshooting/how-to-add-wpdiscuz_votes_separate-when-adding-new-comment/#post-13098</guid>
                    </item>
				                    <item>
                        <title>RE: How to add wpdiscuz_votes_separate when adding new comment</title>
                        <link>https://wpdiscuz.com/community/troubleshooting/how-to-add-wpdiscuz_votes_separate-when-adding-new-comment/#post-13087</link>
                        <pubDate>Wed, 26 Jan 2022 09:49:13 +0000</pubDate>
                        <description><![CDATA[@stevara,
The changes will be lost after the wpDiscuz updates.  
You can use the comment_post hook for this customization. More info here:
We don&#039;t provide support for customization, we m...]]></description>
                        <content:encoded><![CDATA[<p>@stevara,</p>
<p>The changes will be lost after the wpDiscuz updates.  </p>
<p>You can use the comment_post hook for this customization. More info here:</p>
<p><a class="c-link" href="https://developer.wordpress.org/reference/hooks/comment_post/" target="_blank" rel="noopener noreferrer" data-stringify-link="https://developer.wordpress.org/reference/hooks/comment_post/" data-sk="tooltip_parent" data-remove-tab-index="true">https://developer.wordpress.org/reference/hooks/comment_post/</a></p>
<p>We don't provide support for customization, we may help in 1-2 simple questions, but not more. We only help with general questions and issues.</p>
<p>Thank you for your understanding.</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/how-to-add-wpdiscuz_votes_separate-when-adding-new-comment/#post-13087</guid>
                    </item>
				                    <item>
                        <title>RE: How to add wpdiscuz_votes_separate when adding new comment</title>
                        <link>https://wpdiscuz.com/community/troubleshooting/how-to-add-wpdiscuz_votes_separate-when-adding-new-comment/#post-13064</link>
                        <pubDate>Mon, 24 Jan 2022 20:41:27 +0000</pubDate>
                        <description><![CDATA[I handled it when posting new comment from my mobile app by adding 
add_action(&quot;rest_insert_comment&quot;, function ($comment, $request, $creating) {
    add_comment_meta($comment-&gt;comment_I...]]></description>
                        <content:encoded><![CDATA[<p>I handled it when posting new comment from my mobile app by adding </p>
<pre contenteditable="false">add_action("rest_insert_comment", function ($comment, $request, $creating) {
    add_comment_meta($comment-&gt;comment_ID, 'wpdiscuz_votes_seperate', );
    add_comment_meta($comment-&gt;comment_ID, 'wpdiscuz_votes', 0);
}, 10, 3);</pre>
<p>to functions.php in my theme.</p>
<p>It adds these two fields to <strong>commentmeta</strong> table every time a new comment is created.</p>
<p>But it doesn't add these fields when I create a new comment on the website.</p>
<p>Can I add </p>
<pre contenteditable="false">add_comment_meta($commentId, self::META_KEY_VOTES, 0);
add_comment_meta($commentId, self::META_KEY_VOTES_SEPARATE, );</pre>
<p>somewhere in<em> addComment</em> function in <strong>WpdiscuzCore.php </strong>?</p>]]></content:encoded>
						                            <category domain="https://wpdiscuz.com/community/troubleshooting/">How-to and Troubleshooting</category>                        <dc:creator>stevara</dc:creator>
                        <guid isPermaLink="true">https://wpdiscuz.com/community/troubleshooting/how-to-add-wpdiscuz_votes_separate-when-adding-new-comment/#post-13064</guid>
                    </item>
				                    <item>
                        <title>How to add wpdiscuz_votes_separate when adding new comment</title>
                        <link>https://wpdiscuz.com/community/troubleshooting/how-to-add-wpdiscuz_votes_separate-when-adding-new-comment/#post-13061</link>
                        <pubDate>Mon, 24 Jan 2022 18:21:21 +0000</pubDate>
                        <description><![CDATA[I want to post a new comment from react native app using: POST /wp/v2/comments
When I add a comment like that, wpdiscuz_votes_separate and wpdiscuz_votes fields don&#039;t get created in comment...]]></description>
                        <content:encoded><![CDATA[<p>I want to post a new comment from react native app using: <span>POST /wp/v2/comments</span></p>
<p>When I add a comment like that, <em>wpdiscuz_votes_separate</em> and wpdiscuz_votes fields don't get created in <strong>commentmeta </strong>table at that point. They get created when I click on + or - on comment on the website. But I need it to be created immediately because I have to parse <em>wpdiscuz_votes_separate</em> value in order to show the the number of likes and dislikes, and also to be able to update them on the mobile app. I am updating them via endpoint in function.php file.</p>
<p>Can those rows be created with the creation of the comment somehow?</p>]]></content:encoded>
						                            <category domain="https://wpdiscuz.com/community/troubleshooting/">How-to and Troubleshooting</category>                        <dc:creator>stevara</dc:creator>
                        <guid isPermaLink="true">https://wpdiscuz.com/community/troubleshooting/how-to-add-wpdiscuz_votes_separate-when-adding-new-comment/#post-13061</guid>
                    </item>
							        </channel>
        </rss>
		