Last active
April 15, 2022 19:34
-
-
Save DumahX/d4968b08f6d6f2bf8217414078390c38 to your computer and use it in GitHub Desktop.
Workaround for protecting posts using Avada Builder
This file contains 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 | |
add_action('avada_after_content', function() { | |
global $post; | |
if(class_exists('MeprRule') && MeprRule::is_locked($post)) { | |
$unauth_message = (class_exists('MeprRulesCtrl') ? MeprRulesCtrl::unauthorized_message($post) : ''); | |
echo do_shortcode($unauth_message); | |
?> | |
<script> | |
jQuery(document).ready(function($) { | |
$('#content .post-content').remove(); | |
}); | |
</script> | |
<?php | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment