Forked from andrewlimaza/pmpro-open-comments-non-members.php
Last active
October 15, 2024 07:37
-
-
Save dwanjuki/9830d00171afed8028f5d630eaf2620e to your computer and use it in GitHub Desktop.
Allows non-members to view comments and comment on restricted posts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Allows non-members to view comments and comment on restricted posts | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function make_pmpro_comments_open(){ | |
remove_filter("comments_array", "pmpro_comments_filter", 10, 2); | |
remove_filter("comments_open", "pmpro_comments_filter", 10, 2); | |
} | |
add_action( 'init', 'make_pmpro_comments_open' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment