Home › Forums › Front End PM PRO › Icon instead of ‘Send Message’
- This topic has 6 replies, 2 voices, and was last updated 1 year, 10 months ago by Shamim Hasan.
- AuthorPosts
- January 20, 2024 at 4:47 am #45841adminbartParticipant
Hello,
I am a new user of your plugin ‘Front End PM’.
This is very fantastic plugin, thanks!
However, there is one thing I am looking for: At the user list (fep menu directory), I would like an icon instead of the text ‘Send Message’. Because when translating to French (‘Envoyer un message’), the text becomes too long on mobile phones.My screenshot more or less shows what I want. I was working on CSS but this is just very clumsy.
Can anyone help me?
Attachments:You must be logged in to view attached files.January 21, 2024 at 3:18 pm #45845Shamim HasanKeymasterDo you know php? if yes you can use
fep_directory_table_column_content_send_messageaction hook to echo anything you want instead.January 21, 2024 at 5:12 pm #45849adminbartParticipantHello, thank you for your reply.
I’m used to use actions and filters in the functions file.
But I can’t seem to find any doc about that (or any) hook you mention. Can you provide a code example?Allso, is there a way to allways leave the message content open in first instance and not closed? Now I only see the author and a date. It isn’t obvious (for older people) that you have to click to see the content.
January 22, 2024 at 7:26 am #45855adminbartParticipantHello Shamim,
I’ve got te text replaced by an icon, by using this code:
add_action( 'fep_directory_table_column_content_send_message', 'mail_icon',10,1); function mail_icon() { echo '<img src="[URL]" />'; }But there is no link anymore …
January 22, 2024 at 5:14 pm #45857Shamim HasanKeymasterPlease use like following
function mail_icon( $user ) { ?><a href="<?php echo fep_query_url( 'newmessage', array( 'fep_to' => $user->user_nicename ) ); ?>"><img src="[URL]" /></a><?php }January 22, 2024 at 6:19 pm #45858adminbartParticipantHello Shamim, thanks for your reply.
That works, but this link button is also visible next to your own name. This is not the behaviour with the default settings.
Is there more information about the filters and hooks? Just because I don’t like bothering you so much.
January 23, 2024 at 2:38 pm #45860Shamim HasanKeymasterYou can see
class-fep-directory.phpfile (line: 149) for the code. Sorry no documentation is writted for this hook.
You can wrap code if a if block to prevent this. Like followingfunction mail_icon( $user ) { if ( get_current_user_id() != $user->ID ) { ?><a href="<?php echo fep_query_url( 'newmessage', array( 'fep_to' => $user->user_nicename ) ); ?>"><img src="[URL]" /></a><?php } } - 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.