Compatibility with Uncode theme
-
Hello,
Is it possible to please make the content restriction feature compatible with the Uncode theme and themes that don’t use the_content in the traditional way? (I think it uses get_the_content instead)
I have been able to achieve this by editing the plugin and hooking into the_post to hide content earlier in the page request with the below code, dded to simple-membership/classes/class.simple-wp-membership.php.add_filter('the_post', array(&$this, 'filter_content_post'), 999, 1); public function filter_content_post($post){ if (is_preview() || is_admin()) { //If the user is logged-in as an admin user then do not apply filtering for admin side viewing or preview page viewing. if ( current_user_can('administrator') ){ //The user is logged in as admin in this browser. return $content; } } $acl = SwpmAccessControl::get_instance(); $content = $post->post_content; $post->post_content = $acl->filter_post($post, $content); return $post; }
Would you be able to look into testing and adding that code?
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Compatibility with Uncode theme’ is closed to new replies.