Icon instead of ‘Send Message’


Home Forums Front End PM PRO Icon instead of ‘Send Message’

This topic is: Not Resolved

Tagged: , ,

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #45841
    adminbart
    Participant

    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.
    #45845
    Shamim Hasan
    Keymaster

    Do you know php? if yes you can use fep_directory_table_column_content_send_message action hook to echo anything you want instead.

    #45849
    adminbart
    Participant

    Hello, 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.

    #45855
    adminbart
    Participant

    Hello 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 …

    #45857
    Shamim Hasan
    Keymaster

    Please 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
    } 
    
    #45858
    adminbart
    Participant

    Hello 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.

    #45860
    Shamim Hasan
    Keymaster

    You can see class-fep-directory.php file (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 following

    
    function 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
        }
    } 
    
Viewing 7 posts - 1 through 7 (of 7 total)

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.