This is my first time in using mu-plugin. I’m getting an error message at the end of my code but can’t see why. Would appreciate some assistance.
Attempting to set the custom capability at the start of the website based on a custom field value.
Using the following code within file s2-hack.php within the mu-plugins directory.
<?php function setDirectory() { if ((get_user_field('InDirectory')) and (current_user_is("s2member_level1")) or (current_user_is("s2member_level2"))) { $current_user->add_cap('access_s2member_ccap_dir'); } else { $current_user->remove_cap('access_s2member_ccap_dir'); } add_action('init', 'setDirectory'); ?>Getting the following error message:
Parse error: syntax error, unexpected end of file in /home/howard57/public_html/wp-content/mu-plugins/s2-hacks.php on line 10