Reply To: Add Link to a Business Listing


Home Forums Front End PM PRO Add Link to a Business Listing Reply To: Add Link to a Business Listing

#9631
shamim
Keymaster

Please add following code in your theme’s (child theme’s if any) functions.php


add_action( 'fep_display_after_message', function(){
	$authordata = get_userdata( get_the_author_meta('ID') );
	
	if( in_array( 'administrator', $authordata->roles ) ){
		echo '<a href="' . esc_url( home_url( 'business-directory/' ) ). get_the_author_meta('user_nicename') . '">' . get_the_author_meta('display_name') . '</a>';
	}
});

Change ‘administrator’ to whatever your user role is. For testing purpose i have used ‘administrator’ so that you can check that only ‘administrator’ role users link will show.