Notifications
Clear all

Post Author Can't Read Privatized Comment

20 Posts
2 Users
0 Reactions
1,158 Views
Posts: 31
Customer
Topic starter
(@patrick-yuen)
Member
Joined: 4 years ago

Hi Author,

Issue: Post Author Can't Read Privatized Comment

I have enabled "Post author can moderate private comments threads" at backend.

I have a custom code on single-post.php which present the comment number on the post frontend:

 <?php comments_number( '0 個賣家已聯繫', '1 個賣家已聯繫 [不公開]', '% 個賣家已聯繫 [不公開]' ); ?>.

When the comment is privatized, the above function can't show the number out, is there any solution?

Below are the URL and credential:

Post URL: https://jdclab.com/markets/%e7%b4%85%e7%9f%b3/

Login: https://jdclab.com/login

User: tomprice10000 Password: spurspur

Author: koil Password: spurspur

Admin: tim218 Password: $70wwW$KD()!gZlSs&Jq0iMq

Please help~

Many thanks

Patrick

19 Replies
Elvina
Posts: 1403
(@elvina)
Support
Joined: 5 years ago

Hi @patrick-yuen,

When the comment is privatized, the above function can't show the number out, is there any solution?

The number mentioned by you does not have any relation to the wpDiscuz.

I'm sorry but in this case, we can't provide any solution for you.

Reply
16 Replies
Customer
(@patrick-yuen)
Joined: 4 years ago

Member
Posts: 31

@elvina

ok, so i still have another problem that is related to wpdiscuz:

I have enabled "Post author can moderate private comments threads" at backend, but my author still can't see the privatised comment. Please advise.

Reply
Elvina
(@elvina)
Joined: 5 years ago

Support
Posts: 1403

@patrick-yuen,

We know about this bug, and it will be fixed in the next version update.

Reply
Customer
(@patrick-yuen)
Joined: 4 years ago

Member
Posts: 31

@elvina when is the next update?

Reply
Elvina
(@elvina)
Joined: 5 years ago

Support
Posts: 1403

@patrick-yuen,

We can't provide exact data. Probably we will update the add-on in the next week.

Reply
Customer
(@patrick-yuen)
Joined: 4 years ago

Member
Posts: 31

@elvina 

ok thanks! Longing for it.

Reply
Elvina
(@elvina)
Joined: 5 years ago

Support
Posts: 1403

@patrick-yuen,

Please update the add-on to the latest version(v.7.0.1) and check again.

There should not be such an issue anymore.

Reply
Customer
(@patrick-yuen)
Joined: 4 years ago

Member
Posts: 31

@elvina

Thanks!

Is there anyway to make <?php comments_number(); ?> to show the comment number even if the comment is privitized?

Reply
Elvina
(@elvina)
Joined: 5 years ago

Support
Posts: 1403

@patrick-yuen,

Please put this code in your current active theme's functions.php file to show the comment numbers. (The numbers will be displayed for all user, included guests).

add_action("init", function () {
if (class_exists("wpDiscuzPrivateComment")) {
$wpdPrivate = wpDiscuzPrivateComment::getInstance();
remove_filter("get_comments_number", [$wpdPrivate, "getCommentNumber"], 268);
}
});
Reply
Customer
(@patrick-yuen)
Joined: 4 years ago

Member
Posts: 31

@elvina

The code did not work. <?php comments_number still shows only the visible comment.

Any other problem is that, i can't set private/public of the comment in the wp-admin area, please see screenshot. When i click private or public, it does not have any action.

Please advise.

Reply
Elvina
(@elvina)
Joined: 5 years ago

Support
Posts: 1403

@patrick-yuen,

The code did not work. <?php comments_number still shows only the visible comment.

The developers checked again and saw that the code is working as expected, could you please check it again and make sure you are adding the code in the correct way.

Any other problem is that, i can't set private/public of the comment in the wp-admin area, please see screenshot. When i click private or public, it does not have any action.

Please update the wpDiscuz Private Comments add-on to the latest version(v.7.0.3) and check again. There should not be such an issue anymore.

Reply
Customer
(@patrick-yuen)
Joined: 4 years ago

Member
Posts: 31

@elvina

Checked and worked except the <?php comments_number

I input your code in active theme's function php, but did not work. Let me explain:

The only person who can view the privatised comment number is the comment author himself. All others can't see the privatised comment being added to <?php comments_number

Can we do it in this way, can you let me know how can i display the number of privatised comment instead?

Reply
Elvina
(@elvina)
Joined: 5 years ago

Support
Posts: 1403

@patrick-yuen,

As I already mention the number mentioned by you does not have any relation to the wpDiscuz(the number changed before it got to wpDiscuz). Probably there is a plugin conflict or conflict with the current active theme you use. So please deactivate the plugins one by one and check after each deactivation to find the problem maker one. Also please switch some default them before checking.

Once you find the reason of the issue, the code provided by us will work as expected.

Reply
Customer
(@patrick-yuen)
Joined: 4 years ago

Member
Posts: 31

@elvina

Thanks for your information. Can you let me know how can i display the number of privatised comment?

Thanks

Reply
Elvina
(@elvina)
Joined: 5 years ago

Support
Posts: 1403

@patrick-yuen,

As I already mentioned in the above post there is a plugin conflict or conflict with the current active theme. Once you find the reason of the issue, the code provided by us will work as expected and will display the number of privatised comment.

Reply
Customer
(@patrick-yuen)
Joined: 4 years ago

Member
Posts: 31

@elvina

I am thinking to separately display both number of "Privatised" and "Non-Privatised" comment on my blog site. 

Please help, thanks.

Reply
Customer
(@patrick-yuen)
Joined: 4 years ago

Member
Posts: 31

@elvina Any update? Thanks!

Reply
Posts: 31
Customer
Topic starter
(@patrick-yuen)
Member
Joined: 4 years ago

@elvina

Can anyone help me?

Reply
1 Reply
Elvina
(@elvina)
Joined: 5 years ago

Support
Posts: 1403

@patrick-yuen,

You should do it yourself, just get "Privatised" and "Non-Privatised" comments value and display it separately.

Reply
Share:
Scroll to top