The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
How to hide the com...
 
Notifications
Clear all

[Solved] How to hide the comment form for a specific user instead of user role?

7 Posts
2 Users
0 Reactions
2,243 Views
Posts: 6
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@faltushamim)
Active Member
Joined: 5 years ago
[#1056]

We are trying to modify the plugin functionality. We don't find any hook or filter to disable the comment form for a specific user.

 

If we add a filter here then we can achieve what we want.


6 Replies
Asti
Posts: 8218
 Asti
Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@asti)
Illustrious Member
Joined: 8 years ago

@faltushamim,

You should add the custom code in the theme template files and not call the comments_template() function for the current user. 


Posts: 6
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@faltushamim)
Active Member
Joined: 5 years ago

We have some user permission system. Some users can post only public comments and some can post only private comments. We need a way to hide the comment form only from specific users. So the users can't see the submission form but can see the comments. If I follow your suggestion then the whole comment system will be hidden which is not the thing we want.


1 Reply
Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8218
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@faltushamim,

We may suggest the following solution:

  • Install some user role creator plugin,
  • Create some new user role, e.g. "Restrict comment"
  • Change those users' user role to "Restrict comment
  • Then hide the comment form for this user role in wpDiscuz plugin settings. 

Posts: 6
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@faltushamim)
Active Member
Joined: 5 years ago

I do know that I can achieve by following your suggestion. In our case we need a way to to hide the form programmatically. If we have a filter in the line that I showed, we can do that easily without modifying the wpdiscuz plugin.


2 Replies
Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8218
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@faltushamim,

the hook you can use is provided below: 

https://wpdiscuz.com/docs/codex/filters/wpdiscuz_form_render/


(@faltushamim)
Joined: 5 years ago

Active Member
Posts: 6
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@asti

I missed that hook. I think It will work. Thank you very much.