Need to replace “Send a message” with a picture!
-
Hi,
First of all, congrats for this plugin!
I’m trying to upgrade to the latest version because there is too many requests on the SQL DB with the older version, my hosting provider want to kick me out, hope it will be lighter with this version!
I need to modifiy this part :
function bbpm_prepare_contact_button($user_id) { $btn = array( 'link' => null, 'link_title' => null, 'unread_count' => null, 'inner_text' => null ); $user = get_userdata($user_id); if ( !empty($user->ID) ) { $m = bbpm_messages(); if ( $m->current_user ) { $chat_id = $m->getPrivateSharedChat($m->current_user, $user->ID); if ( $chat_id ) { $btn['link'] = bbpm_messages_url($chat_id, $m->current_user); $btn['unread_count'] = $m->getChatUnreadCount($chat_id); } else { global $bbpm_bases; $btn['link'] = bbpm_messages_url(sprintf('%s/%d/', $bbpm_bases['with'], $user->ID), $m->current_user); } } else { $btn['link'] = apply_filters( 'bbpm_redirect_login_url', wp_login_url() ); } $btn['link_title'] = sprintf(__('Send %s a Message', BBP_MESSAGES_DOMAIN), $user->display_name); } $btn['inner_text'] = __('Send a Message', BBP_MESSAGES_DOMAIN); return apply_filters('bbpm_prepare_contact_button', $btn, $user_id); }
Which is way harder than the previous version, here is my old code :
add_filter('bbp_template_after_user_profile', function() { $user_id = bbp_get_displayed_user_id(); global $current_user; if( empty( $current_user->ID ) || !get_userdata( $user_id ) || $user_id == $current_user->ID ) return; ob_start(); ?> <p> <a href="<?php echo bbpm_messages_base( get_userdata( $user_id )->user_nicename . '/', wp_get_current_user()->ID ); ?>"><img src="/wp-includes/images/mail.png" title="Send a PM"></a> </p> <?php echo apply_filters('bbpm_bbp_template_after_user_profile', ob_get_clean()); });
Would be great if someone can help me to put a
<img src="/wp-includes/images/mail.png" />
instead of the classical ” send a message”.Thanks!
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Need to replace “Send a message” with a picture!’ is closed to new replies.