I use a plugin called "Live Edit" to let authors and editors edit the content front-end. But the issue is that the plugin lets any logged in users to edit the content. I want the edit(specified by plugin. Not the WP's default edit button) button be accessed based on their roles. I don't know how to make it accessible based on roles. So trying to make it appear only for the authors and higher roles to that.
I want to do something like this in loop.php:
<?php
global $current_user;
get_currentuserinfo();
if ( user_can( $current_user, "author" ) ){
// Show Role
// Show Subscriber Image
}
Here is the code:
<?php post_class( 'post clearfix ' . $themify->get_categories_as_classes(get_the_ID()) . ' ' . $themify->get_post_color_class(get_the_ID()) ); if(function_exists("live_edit")){ live_edit('post_title, field1'); } ?>
and
<div <?php if(function_exists("live_edit")){ live_edit('post_content, myfield2'); }?>>
<?php if( function_exists('the_field') ) the_field('myfield1'); ?> </div>
<?php if( function_exists('the_field') ) the_field('myfield2'); ?>
</div>
I am unsure how to do it in the template or through functions.php. Could any one help me or guide through that to achieve what I want?
Here is the loop.php at pastebin - http://pastebin.com/9MVY64LJ
The live edit class is used in line 8 and line 57.