Get site-wide comment status in PHP
-
Hello,
Is there a PHP function in which I can get the selected option? For example if the disable all option is selected it returns ‘all’ and when it is disabled only for pages, it returns ‘pages’, etc.
Let me know.
-
Hi @studioviv ,
Thank you for your suggestion.At the moment, there isn’t a public PHP function available to directly retrieve the selected comment disable option (e.g., ‘all’, ‘pages’, ‘posts’, etc.) from the plugin settings.
However, we appreciate your input and will discuss this with our team. We’ll let you know if there are any updates or changes regarding this feature.
Best regards,
Hi @studioviv , as per your request, we’ve added two new functions to get settings details and included option details in Site Health. Could you please check and test if it works for you from this branch: https://github.com/WPDevelopers/disable-comments/tree/alim-dev
You can check this commit to see the details: https://github.com/WPDevelopers/disable-comments/commit/f16cee5a4f939bcf8bb1f1d98e5b27103dc632ee
Please let us know if it works for you.
Thank you!
Hello Abid,
Thank you for the links and adding those functions. I’ll check them out and add them to the conditional logic of my custom plugin.
Best Regards.
-
This reply was modified 3 months ago by
DODO Internet.
Hello Abid,
When I try to install the plugin from Github, I could not activate it. It say it causes a fatal error. Downloaded I the correct version with this new feature?
Hello Abid,
I found out the fatal error. This was generated because of the original plugin. Once I deactivated it and activated the one from Github. I did activated. It is working like a charm! Only when I have selected pages and media, the function get_current_comment_status returns multiple. Which is fine for me, but it might be more useful if it returns “pages,media”.
For me this function is very helpfull and I can continue on my plugin. Will this be added in version 2.5.3 of the main plugin? Or do I need this custom version from Github?
Hi @studioviv , thanks for confirming! And yes, sorry I should have mentioned earlier that if you download the another branch from GitHub, you need to rename the plugin to the original plugin name (disable-comments) first, and make sure there’s no subfolder inside the main folder. Glad you got it sorted out.
We’re also planning to merge this into the main version and release it next week. Until then, please continue using this version. Once we release, we’ll ping you again in this thread.
Thank you!
Hello Abid,
That’s great. Thanks so much for the quick responses and for adding these features.
Best regards.
Hi @studioviv ,
We’ve released v2.5.3 with the requested functions supported. You can now completely delete your current version (as I believe you’re using a different folder name) from WordPress and then install the new version from WordPress.
Hope this works for you. Please let me know.
Thank you!Hi @studioviv , just checking, have you installed the new version of Disable Comments, and is everything working now?
Hello Abid,
I haven’t checked it. So I have now updated the plugin and removed the other plugin. After that I checked it again and it is working.
Thank you for adding this feature to the plugin.
Awesome @studioviv !
Glad to know that it works! Thanks for contributing. If you love Disable Comments please feel free to review us from here: https://wordpress.org/support/plugin/disable-comments/reviews/#new-post
Cheers!
-
This reply was modified 3 months ago by
You must be logged in to reply to this topic.