Home › Forums › Front End PM PRO › How to make checkbox show for some user roles but not others and not loose its v
- This topic has 2 replies, 2 voices, and was last updated 7 years, 1 month ago by ADM.
- AuthorPosts
- November 7, 2018 at 3:26 am #18835ADMParticipant
Hi I’m pretty stuck so any help would be awesome. I edited the plugin and got it almost exactly as I need it except for the input checkboxes with a value. I need the checkboxes to appear for only the user that is allowed to ‘send-new-message’. For the rest of the plugin I managed to work it out by coding like this around the element:
<?php
if ( fep_current_user_can( ‘send_new_message’ ) ) {
echo ‘<div class=”fep-bulk-action”>’;
}
?>
but this is in the ‘template’ file of the plugin and it worked perfectly.The check box code that’s giving me trouble is in ‘includes’ heres the code (including a the break and case just to give context):
break;
case ‘fep-cb’:
?>
<input type=”checkbox” class=”fep-cb” name=”fep-message-cb[]” value=”<?php echo fep_get_the_id(); ?>” />
<?phpbreak;
case ‘author’:
how do I add:if ( fep_current_user_can( ‘send_new_message’ ) ) {
echo
without losing the ‘value’ or the functionality of the checkboxes?see attached for how it looks now. the ‘what subscriber sees’ screenshot is what where I want those checkboxes to the left to be removed
Thanks for your time
Attachments:You must be logged in to view attached files.November 7, 2018 at 7:31 pm #18875Shamim HasanKeymasterWhich version you are using? It is recommended always use latest version.
You can use hooks to change almost anything of this plugin, so that you will not lose any changes when you update this plugin.To change checkbox output you can add following code in your theme’s functions.php
add_action( 'fep_message_table_column_content_fep-cb', function(){ if ( fep_current_user_can( 'send_new_message' ) ) { ?><input type="checkbox" class="fep-cb" name="fep-message-cb[]" value="<?php echo fep_get_the_id(); ?>" /><?php } });November 8, 2018 at 11:22 pm #18915ADMParticipantworked thanks!!
- AuthorPosts
You need to purchase ‘Front End PM PRO’ to create topic in this support forum.
If you already purchased ‘Front End PM PRO’ please LOGIN.