Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'private message button'

Viewing 25 results - 26 through 50 (of 231 total)
  • Author
    Search Results
  • matwin23
    Participant

    yes, i use this code…

    // ADD SHORTCODE TO SINGLE PRODUCT – PM link
    add_action( ‘woocommerce_share’, ‘enfold_customization_extra_product_content’, 15 );
    function enfold_customization_extra_product_content() {
    echo do_shortcode(“[bp-pm-button]”);
    }

    //////////////////////////////////////////////////////////////////
    // BuddyPress send private message button
    //////////////////////////////////////////////////////////////////

    /**
    * Get a link to send PM to the given User.
    *
    * @param int $user_id user id.
    *
    * @return string
    */
    function buddydev_get_send_private_message_to_user_url( $user_id ) {
    return wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . ‘/compose/?r=’ . bp_core_get_username( $user_id ) );
    }

    /**
    * Shortcode [bp-pm-button username=optional_some_user_name]
    *
    * @param array $atts shortcode attributes.
    * @param string $content content.
    *
    * @return string
    */
    function buddydev_private_message_button_shortcode( $atts, $content = ” ) {
    // User is not logged in.
    if ( ! is_user_logged_in() ) {
    return ”;
    }

    $atts = shortcode_atts( array(
    ‘user_id’ => ”,
    ‘username’ => ”,
    ‘label’ => ‘Send this Member a Message’,
    ), $atts );

    $user_id = absint( $atts[‘user_id’] );
    $user_login = $atts[‘username’];

    // if the username is given, override the user id.
    if ( $user_login ) {
    $user = get_user_by( ‘login’, $user_login );
    if ( ! $user ) {
    return ”;
    }
    $user_id = $user->ID;
    }

    if ( ! $user_id ) {
    if ( ! in_the_loop() ) {
    return ”;
    }

    $user_id = get_the_author_meta(‘ID’ );
    }
    // do not show the PM button for the user, if it is aimed at them.
    if ( bp_loggedin_user_id() === $user_id ) {
    return ”;
    }

    // if we are here, generate the button.
    $button = sprintf(‘%2$s‘, buddydev_get_send_private_message_to_user_url( $user_id ), $atts[‘label’] );

    return $button . $content;
    }

    add_shortcode( ‘bp-pm-button’, ‘buddydev_private_message_button_shortcode’ );

    matwin23
    Participant

    Hi

    How can I add code to my functions.php to create a button (or text link) displayed on a woocommerce product page to send a Private Message to the buddypress member/author who upload the product?

    The site is using a multi-vendor plugin, WCFM, to create/publish the products.

    Thanks in advance.

    joeyleblanc94
    Participant

    Hi,

    I am using buddypress with Gwangi theme to make it a social media website, i want to hide private button on member when they are not friends.

    here’s my code.

    add_filter( 'bp_get_send_message_button', function( $array ) {
        if ( friends_check_friendship( bp_loggedin_user_id(), bp_displayed_user_id() ) ) {
            return $array;
        } else {
            return '';
        }
    } );

    What should i do and where should i apply my code to achieve the customisations.

    #309830
    bmcconach
    Participant

    Howdy, BuddyPress friends!

    I have been working on a project for fun and have been enjoying the laying out of items and adding plugin functionality a bit much here lately. So much so, in fact, that I put the testing phase on the back shelf for a bit.

    When I was attempting to request membership from a test account to a private group that my admin account was the creator of, I ran into an issue: I can get to the request page (/groups/test-group/request-membership/?_wpnonce=47febc75fe) by clicking the link to do so and then am presented with a textarea for request comments, however when I submit the form (with or without comments) I am taken back to the group’s main page (/groups/test-group/) and am presented with “There was an error sending your group membership request. Please try again.” The request does not come through (not in BP’s notifications, e-mail, pending requests, etc.) at all.

    At first this was a minor irritation because I could go to the group as the admin and invite the test account to join the group. There I am presented with a checkbox for my test account’s name, as well as a submit button; however when clicking on the checkbox, the form instantly submits without ever sending an invite. I even attempted to modify the live source to set the field to checked, attempted to submit, and received a success message stating my invite was sent, but of course it never was.

    I have checked the list of plugins I have on my site, disabled a few I didn’t necessarily need, and have checked each of the remaining to see if there’s any sort of conflict between plugins affecting groups, but to no avail. This functionality is key to the use of groups for my project, so I would sincerely appreciate any advice from more knowledgeable members of the BP community.

    Some support information, including a list of active plugins, can be found below. Please note that any plugin with ** beside it came bundled with the theme.

    == Server Environment ==
    	Operating System: Linux
    	Software: Apache/2.4.6
    	MySQL version: MariaDB Server v5.5.61-MariaDB-38.13
    	PHP Version: 7.2.24
    	PHP Max Input Vars: 2500
    	PHP Max Post Size: 64M
    	GD Installed: Yes
    	ZIP Installed: Yes
    	Write Permissions: All right
    	Elementor Library: Connected
    
    == WordPress Environment ==
    	Version: 5.3.2
    	WP Multisite: No
    	Max Upload Size: 64 MB
    	Memory limit: 512M
    	Permalink Structure: /%postname%/
    	Language: en-US
    	Timezone: America/New_York
    	Debug Mode: Inactive
    
    == Theme ==
    	Name: Gwangi
    	Version: 2.1.1
    	Author: Themosaurus
    	Child Theme: No
    
    == User ==
    	Role: administrator
    	WP Profile lang: en_US
    	User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36
    
    == Active Plugins ==
    	(BuddyDev) BP Auto Login on Activation
    		Version: 1.0.3
    		Author: Brajesh Singh
    
    	Author Avatars List**
    		Version: 1.18
    		Author: Paul Bearne
    
    	Awesome Weather Widget
    		Version: 3.0.2
    		Author: Hal Gatewood
    
    	bbPress
    		Version: 2.6.3
    		Author: The bbPress Contributors
    
    	BP Messages Tool
    		Version: 2.1
    		Author: PhiloPress
    
    	BP Profile Search
    		Version: 5.2.4
    		Author: Andrea Tarantini
    
    	BuddyPress
    		Version: 5.1.2
    		Author: The BuddyPress Community
    
    	BuddyPress Default Cover Photo
    		Version: 1.6.0
    		Author: SeventhQueen
    
    	BuddyPress Extended Friendship Request
    		Version: 1.2.0
    		Author: BuddyDev Team
    
    	BuddyPress Reorder Tabs
    		Version: 2.0.1
    		Author: BuddyBoss
    
    	BuddyPress Xprofile Custom Field Types
    		Version: 1.1.3
    		Author: BuddyDev
    
    	Classic Editor
    		Version: 1.5
    		Author: WordPress Contributors
    
    	Classic Editor Addon
    		Version: 2.6.0
    		Author: Pieter Bos, Greg Schoppe
    
    	Dashboard Notepad
    		Version: 1.42
    		Author: Stephanie Leary
    
    	Easy Custom Sidebars**
    		Version: 1.0.10
    		Author: Titanium Themes
    
    	Elementor**
    		Version: 2.8.3
    		Author: Elementor.com
    
    	Envato Market
    		Version: 2.0.3
    		Author: Envato
    
    	Essential Addons for Elementor
    		Version: 3.7.1
    		Author: WPDeveloper
    
    	Grimlock**
    		Version: 1.2.5
    		Author: Themosaurus
    
    	Grimlock Animate**
    		Version: 1.1.0
    		Author: Themosaurus
    
    	Grimlock for Author Avatars List**
    		Version: 1.0.4
    		Author: Themosaurus
    
    	Grimlock for bbPress**
    		Version: 1.0.3
    		Author: Themosaurus
    
    	Grimlock for BuddyPress**
    		Version: 1.1.4
    		Author: Themosaurus
    
    	Grimlock for Elementor**
    		Version: 1.0.1
    		Author: Themosaurus
    
    	Grimlock for Jetpack**
    		Version: 1.0.4
    		Author: Themosaurus
    
    	Grimlock for Testimonials by WooThemes**
    		Version: 1.1.0
    		Author: Themosaurus
    
    	Grimlock for The Events Calendar**
    		Version: 1.1.2
    		Author: Themosaurus
    
    	Grimlock Hero**
    		Version: 1.0.7
    		Author: Themosaurus
    
    	Grimlock Isotope**
    		Version: 1.0.7
    		Author: Themosaurus
    
    	Grimlock Login**
    		Version: 1.0.10
    		Author: Themosaurus
    
    	Hide Admin Bar
    		Version: 0.3.9.9
    		Author: Shelby DeNike
    
    	If Menu - Visibility control for menu items
    		Version: 0.15
    		Author: Layered
    
    	Kirki Customizer Framework**
    		Version: 3.0.45
    		Author: Ari Stathopoulos
    
    	MediaPress
    		Version: 1.4.6
    		Author: BuddyDev
    
    	Menu Image**
    		Version: 2.9.5
    		Author: Rui Guerreiro
    
    	Simple Buddypress Profile Privacy
    		Version: 0.7.9
    		Author: Justin Hansen
    
    	Social Articles
    		Version: 2.9.5
    		Author: Broobe
    
    	The Events Calendar
    		Version: 4.9.14
    		Author: Modern Tribe, Inc.
    
    	UpdraftPlus - Backup/Restore
    		Version: 1.16.21
    		Author: UpdraftPlus.Com, DavidAnderson
    
    	Verified Member for BuddyPress**
    		Version: 1.1.1
    		Author: Themosaurus
    
    == Must-Use Plugins ==
    	Gateway Relay
    		Version: 1.0
    		Author: Arnold Bailey (Incsub)
    
    	rms_unique_wp_mu_pl_fl_nm.php
    		Version: 
    		Author: 
    
    	WPMU Assist
    		Version: 1.0.2
    		Author: Arnold Bailey (Incsub)
    
    == Elements Usage ==
    	
    	wp-page : 12
    		eael-adv-tabs : 1
    		google_maps : 1
    		image-carousel : 1
    		shortcode : 1
    		text-editor : 1
    		wp-widget-grimlock_author_avatars_section_widget : 1
    		wp-widget-grimlock_posts_section_widget : 1
    		wp-widget-grimlock_query_section_widget : 1
    		wp-widget-grimlock_section_widget : 3
    		wp-widget-grimlock_the_events_calendar_tribe_events_section_widget : 1
    
    == Log ==
    	
    PHP: showing 1 of 1PHP: 2020-01-02 10:43:38 [error X 1][/home/*****/public_html/wp-content/plugins/elementor/elementor.php::97] Cannot redeclare elementor_fail_wp_version() (previously declared in /home/*****/public_html/wp-content/plugins/elementor/elementor.php:97) [array (
      'trace' => '
    #0: Elementor\Core\Logger\Manager -> shutdown()
    ',
    )]
    
    JS: showing 1 of 1JS: 2020-01-11 16:50:05 [error X 1][https://*****/wp-content/plugins/grimlock/assets/js/navigation-stick-to-top.js?ver=1.2.5:27:45] Cannot read property \'top\' of undefined
    #309440
    werny
    Participant

    After updating Buddypress I noticed some strange things:
    – I have two buttons for “Private Message” on my Member-List-page.
    – Also I have double settings (General and Style) in my customizer page:
    Settings Customizer

    What can I do?

    #309154
    ekadevau
    Participant

    Hi folks,
    we have a private group where a user sent out some invites. The list under “pending invites” (like here: checking for pending invites) offers a “delete” or “remove” button. However, clicking on it won’t remove anything but give the generic error message “Group invitation could not be removed”. This happens with expired invites as well as with new invites.

    Running on Buddypress 5.0.0 on WordPress 5.2/5.3, additional BP-Plugins Group Email subscription, and the Woffice Theme (nothing special about invitations here, I think).

    Is there – besides this screen – any option to remove pending invites to renew an invitation? And: do invitations really expire? At this point I’m not sure it’s a user issue, but I can reproduce the “cannot remove” issue with new invitations as mentioned.

    Thanks for any hint!

    regards
    eka

    #309069

    In reply to: Private message

    webmasterfreya
    Participant

    Tried it,
    I click on “Private message” and arrive on my profile.
    Only have to fill in the subject and the text. The recipient is already filled in.

    e.g.
    Verzend naar (gebruikersnaam of naam van een vriend)

    ProfielfotoStephanie123

    Dit is een aankondiging voor alle gebruikers.
    Onderwerp [subject field]
    Bericht [message field]
    [send button]

    So in your case it is not normal behaviour.

    searchngp
    Participant

    How can i show the private message button in the activity stream, just like comment or favorite

    #308163
    puzzleman
    Participant

    When I activate this topic some members cannot send private messages. Pressing the “Send” button does nothing.

    spings
    Participant

    RE–Changing ‘Private Message’ to ‘Message’ throughout BuddyPress and bbPress

    Would like to remove the word ‘private’ from anywhere ‘private message’ automatically appears, so that these always just say ‘message’, not ‘private message’.

    The last answer here was 5+ years ago:

    Topic: Private Message Button Label Change · BuddyPress.org

    Is this still the last word? Any BuddyPress based themes, plugins, add-ons, or a way to do this simply? Considering using Front End PM to sidestep this issue.

    Thanks for suggestions or help.

    #307309

    Topic: Profile Page

    in forum Miscellaneous
    abdullqh
    Participant

    Hello,

    How do I make the change in the picture below? I just want to move the “Private Message” button to the location shown in the picture.
    http://www.vegvorous.com/res/private.jpg

    #307297
    BuddyBoss
    Participant

    Hey Brajesh!

    Sure, happy to provide some additional feedback.

    I have tried your releases and I am still wondering what prevented you/your team from contributing to BuddyPress? Did you try to contribute or was there some other reason for fork?

    There are a lot of reasons we decided to go our own way. The primary one is that at a very fundamental level, BuddyPress was not providing the experience our customers are looking for and was really holding us back in our ability to provide the features and usability they ask us for. We have many thousands of customers and do a large amount of custom development, and there are so many things they ask for and wish were different in BuddyPress. BuddyPress development moves very slowly, and the types of changes we have implemented and will continue to implement require major changes to BuddyPress, in a way that can only be done by forking the plugin. We do theme development and mobile app development, and it’s not good that the foundation we rely on for everything is not under our control, and actually has barely changed at all over the past 5 years. We need to control its direction completely to achieve what we are trying to do. We are making mobile apps and other things, and want complete vertical integration between everything to provide an amazing experience.

    is there any future plan available for the platform?

    We have a multi-year plan for features we want to add. We also build mobile apps that replicate BuddyPress functionality into a synchronized app, and we will continue to grow there over time. Now that we control our core platform we can move much faster.

    The features we add are determined primarily by our customers. So the order in which things are added will depend to a large degree on what people ask for, and which requests have the highest volume of requests. We have a big support team responding to and noting requests.

    One major area of focus right now is performance. With each release you will see the product get faster. BuddyPress falls apart when it has too many users. We plan to fix that.

    Since the forking of BuddyPress, can you please provide what kind of new feature other than merging your own/others plugin into the bundle have your team added.

    Sure, this is going to be a very long list. I am just listing the high level items, as we have done so many smaller changes throughout.

    Layout

    We have our new BuddyBoss Theme which is much more advanced than any BuddyPress theme. It is only possible because we forked BuddyPress and are able to change the templates as necessary to accomplish our designs. Because we control our platform now, we can be sure that every single feature added is always styled in a consistent way, and with a unified admin experience. It much more powerful, and simultaneously, simpler and lighter than anything we could provide before.

    Profile Fields > Proper “Name” fields

    BuddyPress has just one name field, which drives customers crazy. They want professional networks with First/Last Name, or private networks with just nickname. BuddyBoss Platform has dedicated name fields for First Name, Last Name, Nickname. The site admin can control how to display names sitewide using this. In BuddyPress it is actually impossible just to display First Name + Last Name in the profile and activity feed, something that 50% of customers want. In BuddyBoss it is very customizable. We also let users change their Nickname (handle) any time.

    Profile Fields > Repeater Fields

    This is a request we have gotten for years, and could never provide; the ability to have repeater fields (Jobs, Experience, etc) so you can make a profile like LinkedIn. That’s out of the box now.

    Activity

    We have completely overhauled activity feeds. Instead of separated tabs, which is super confusing, it’s one unified activity feed. And within the feed, we have added a bunch of features:

    – Emoji
    – Animated GIFs
    – Likes
    – Follow
    – Link previews
    – Media
    – Ability to add any custom post type into the feed (via the Settings)
    – Ability to enable/disable any default BP activity type (via the Settings)

    Messages

    We have completely overhauled Messages. In BuddyPress, messages is a really poor experience. It uses a Gmail convention with subject and content, which makes little sense on a social network. We changed it into a single threaded message, just like Facebook, LinkedIn, WhatsApp, and every other messenger works. This allows us to create a really amazing messaging experience (go play with our demo). Also we can extend this later into live chat, and messenger in our apps. Those features could not be built using BuddyPress messenger as it uses a Gmail style messenger. Imagine if Facebook messenger worked like Gmail, it would be awful.

    Media

    We added a native Media component for photos and albums, which provides a really amazing interface. It’s not just a fork of our old media plugin, it’s a total overhaul and is much nicer than anything out there for BuddyPress. And we will extend it over time for videos and other media.

    Private Network

    Out of the box, with one click you can make the whole site private from outsiders. This is a feature that more than 50% of BuddyPress users are doing but need to hunt for 3rd party plugins to figure out how to add. Our implementation is highly customizable also, in terms of what is public vs private.

    Network Search

    We added a new component for searching all content across the social network, with live results as you type. It’s not just a fork of our old BP Global Search plugin, it is a complete overhaul and is a much nicer experience.

    User Invites

    We added an invites system, to allow users to invite others into the network by email.

    Profile Types

    We added a built in interface for creating and managing Profile types, and many additional related options.

    Group Types

    We added a built in interface for creating and managing Group types, and many additional related options.

    Group Hierarchies

    We added a built in interface for creating and managing Group hierarchies, so you can have parent and child group relationships.

    Email Layouts

    Emails in BuddyPress look really bad. This is something we have had to hack up in the past on virtually every client site to give them something usable. Now, in BuddyBoss they look really beautiful out of the box, and are more customizable with logo options etc.

    Default Data

    This comes up constantly, people want to quickly add a bunch of default data into the site for testing. Now they can do it with the click of a button.

    And… that’s just the high level stuff. We have fixed usability issues all over the place and added minor options throughout. And don’t forget that we have been live to the public for less than 2 months. There is much more to come and we are moving fast. Revisit this in a year from now, and the list will be endless.

    #307253
    james4177
    Participant

    I am new to WordPress and Buddypress. I have a couple of items I am struggling with and would love a little direction.

    1. In Buddypress, when you visit a group that is private, you receive a default message that says “This is a private group. To join you must be a registered site member and request group membership.” I would like to add a button directly below this message that says “Register”. This would need to be connected with the default message in some way so that the register button appears every time (and for every different group) the default message is displayed. I tried before but it seemed to connect the button only to one particular group. How can I go about adding this to the default message and what file and where in that file would I edit such a thing?

    2. Once they press the button to register, how do you get them to redirect back to the group they were originally linked to?

    3. In Buddypress, is there any way to turn off the public, private, or hidden options when creating a group and just make all groups private automatically?

    I would really appreciate any assistance. Thank you.

    kirsteno
    Participant

    I cannot get the Add Friends, Public and Private Message buttons to show on my profile.
    I have switched to Twelve sixteen, seventeen and nineteen and turned off all plugins except BuddyPress.
    I have uninstalled and reinstalled Buddypress several times
    I have also tried on another website I have with the same themes and no other plugins.
    I am using
    Wordpress 5.2.2
    Buddypress 4.3.0
    https://ozzyspals.com/
    I don’t even know exactly where these will buttons appear. I have even googled google images in desperation. Do they appear on the main page or in the sub-pages?
    Any help gratefully accepted!
    Kirsten

    #306891

    Topic: Profile Buttons

    in group forum Installing BuddyPress
    axelmire
    Participant

    WP Twenty Ninteen V:1.4
    BP 4.3.0 Nouveau

    Hi, by default the Add Friend button is first in line followed by Send Public Message then Send Private Message buttons. I would like to move the Add Friend button position so it displays third in line after the message buttons. I have tried the solutions offered with no luck. Thank you for any help.

    artichoku
    Participant

    I’ve seen a few posts similar to this, but not this exact problem so I thought it would be safe to make a new post. My users can compose a message, but the send button isn’t working. It’s not grayed out, it just doesn’t do anything. I’ve tried disabling all other plugins, still nothing.

    gatehousedesign
    Participant

    Hi there,

    I have installed buddypress and everything is working except there are no “add friend” or public/private message buttons under the cover photo, to the right of the profile photo.

    Troubleshooting steps I have already taken:

    1. Plugins – I deactivated them all except buddypress, refreshed page, no buttons.

    2. Theme – I am using a theme called Video Pro which is compatible with Buddypress and has some integration settings too. Others seem to be using Buddypress fine and there are no issues on their support forums with it.

    3. I deleted the plugin and reinstalled a fresh version. Still no buttons.

    4. I am running this on a regular domain, not a subdomain but I have the site password protected. I added a couple of users to Buddypress so that there would be friends to add. If I go to the member directory I can request friend there but not from the other buddypress pages as I expected to see.

    5. The code in the area I think they should be looks like this:

    <div id="item-header-content">
    
    							<h2 class="user-nicename">@gatehousedesign</h2>
    			
    			<ul class="member-header-actions action"> </ul>
    			
    							<div class="item-meta">
    
    					<span class="activity">active right now</span>
    				</div><!-- #item-meta -->
    			
    		</div><!-- #item-header-content -->

    Anyone have any ideas? Much appreciated if you do. Maybe there’s some privacy setting I haven’t unchecked…? Or a conflict? I don’t see any errors in console.

    Thanks,
    GWD

    cmeistercs
    Participant

    I want to change the messaging button colors in the profiles. I also want to resize the buttons and button text to make them a bit larger. Thanks!

    #303695
    cdtrue
    Participant

    Thank you! That gets me half way 🙂

    I still get the notification after registration about the activation link – and I do not think that the little old ladies using my site will get that they have to activate and then wait for approval (to much for them to take in).

    So I now are able to stop users with the extra My Private Site-plugin and the messages sent out from BP egistration works as a charm. There is only one (Account Approved Email) that actually is sent though – I can not figure out how to get the other ones to override the BuddyPress – activation-email. And if I de-activate that e-mail no e-mail is sent at all.

    Also when I click on the register-button in the registration form I get redirected to a page that says that my account needs to be activated and I have to check my e-mail to do so. I want to loose it or change the text.

    If they try to log in anyway they get the wordpress opt of re-sending the activation-link. Same thing here – preferably change the text.

    But where do I find the texts? I guess the re-direct page is automated from BP, the other one is from WP.

    Any tips?

    #303397
    Venutius
    Moderator

    Hi there, are you using the Nouveau template at all? If so I reckon a better way to do this would be to remove the private message button from the buttons array using the bp_nouveau_get_members_buttons filter.

    So something like:

    add_filter( 'bp_nouveau_get_members_buttons', 'venutius_check_private_message_button' );
    
    function venutius_check_private_message_button( $buttons ) {
        if ( ! pmpro_hasMembershipLevel('Premium') ) {
            unset( $buttons['private_message'] );
        }
        return $buttons;
    }
    #303287
    devbad
    Participant

    I am looking for some help with restricting private messages.

    I have Paid Memberships Pro – BuddyPress Add On Version 1.2.1 and BP Better Messages (Premium) Version 1.9.7.9 with WordPress 5.1
    BuddyPress Version 4.2.0

    I am looking for a way to restrict the private message option for certain type of users. I am trying to have this modification multiple ways, with and without PMPro but none of them working so far.

    With PMPro I supposed to restrict easily, still I can only totally restrict all BuddyPress functions or enable all of them, customization looks like broken.

    I looked into the codes of all the mentioned plugins, tried to restrict access by using below code that I found in another topic:

    add_filter( 'bp_get_send_message_button', function( $array ) {
        if ( pmpro_hasMembershipLevel('Premium') ) {
            return $array;
        } else {
            return '';
        }
    } );

    Maybe I am just trying to make it too complicated and there is an easier way to do it with shortcodes under the Members page that currently contains only [bps_directory] shortcode.

    Any suggestion and help would be welcome.

    #303038
    matwin23
    Participant

    Hi guys,
    I have mentioned this previously and was hoping a few of the past WP and plugin updates may have resolved this, however it still persists.
    I am running a multivendor site with WC Vendors, Woocommerce, BuddyPress plus other plugins.

    When a member goes to send a private message to a member/vendor from either the members profile ‘private message’ button or from the contact vendor link in a woocommerce product listing, the message fails to send (please see video link below).

    However if i go to my own BP profile, messages, compose and send a message that way it does send.

    Not sure what is happening here. It used to work fine prior to BP4.0

    Video of issue;
    https://www.dropbox.com/s/kkxl2b2bm5vicy4/BP%20Private%20message%20issue.mkv?dl=0

    thanks
    matt

    shanebp
    Moderator

    If you mean the Private Message button at the top of a profile page, then place this code in bp-custom.php or in your theme > functions.php

    function lindsay_profile_button() {
    ?>
    	<div class="generic-button"><a href="https://google.com" >go to google</a></div>
    <?php
    }
    add_action( 'bp_member_header_actions', 'lindsay_profile_button', 25 );

    If ‘Private Messaging’ means something else, then you need to talk to the creators of that code because it does not come from BuddyPress.

    #282256
    ncovello
    Participant

    Hello,

    I made a button below each post for sending a message to the post author. But I need also that the subject line fills automatically with the post title and ID.

    This is the code I have now:

    /**
     * Get a link to send PM to the given User.
     *
     * @param int $user_id user id.
     *
     * @return string
     */
    function buddydev_get_send_private_message_to_user_url( $user_id ) {
        return wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r=' . bp_core_get_username( $user_id ));
    }
    
    /**
     * Shortcode [bp-pm-button username=optional_some_user_name]
     *
     * @param array $atts shortcode attributes.
     * @param string $content content.
     *
     * @return string
     */
    function buddydev_private_message_button_shortcode( $atts, $content = '' ) {
    
    $atts = shortcode_atts( array(
    'user_id'   => '',
    'username'  => '',
    'label'     => 'Send Private Message',
    ), $atts );
    
    $user_id = absint( $atts['user_id'] );
    $user_login = $atts['username'];
    
    // if the username is given, override the user id.
    if ( $user_login ) {
    $user = get_user_by( 'login', $user_login );
    if ( ! $user ) {
    return '';
    }
    $user_id = $user->ID;
    }
      
    if ( ! $user_id ) {
    if ( ! in_the_loop() ) {
    return '';
    }
    
    $user_id = get_the_author_meta('ID' );
    }
    
    }
    
    add_shortcode( 'bp-pm-button', 'buddydev_private_message_button_shortcode' );
    
    /**
     * Get the button for the post author.
     *
     * @return string
     */
    function buddydev_get_author_private_message_button() {
        if ( ! in_the_loop()) {
            return '';
        }
     
        $user_id = get_the_author_meta('ID');
        // can't pm to themselves.
        if ( bp_loggedin_user_id() === $user_id ) {
            return '';
        }
     
        return sprintf('<a class="sg-popup-id-11605" id="private-message-bp" href="%1$s">%2$s</a>', buddydev_get_send_private_message_to_user_url( $user_id ), 'Send Private Message' );
    }
    
    /**
     * Do you want to automatically inject the button on each post?
     *
     * @param string $entry_content entry content.
     *
     * @return string
     */
    function buddydev_inject_private_message_button( $entry_content ) {
        // append at the bottom.
        $entry_content = $entry_content . buddydev_get_author_private_message_button();
        // if you want to only do it on single entry pages(single post etc), you can comment the above line
        // and uncomment the block below
        /* if ( is_singular() ) {
            $entry_content = $entry_content . buddydev_get_author_private_message_button();
        } */
     
        // want to test for a post type, you may use is_singular('post_type_name') instead of is_singular()
        return $entry_content;
    }
    // append to the post entry?
    add_filter( 'the_content', 'buddydev_inject_private_message_button' );

    Thank you!

    Prashant Singh
    Participant
    <?php
    /**
     * BP Nouveau Messages main template.
     *
     * This template is used to inject the BuddyPress Backbone views
     * dealing with user's private messages.
     *
     * @since 3.0.0
     * @version 3.1.0
     */
    ?>
    <div class="subnav-filters filters user-subnav bp-messages-filters" id="subsubnav"></div>
    
    <div class="bp-messages-feedback"></div>
    <div class="bp-messages-content"></div>
    
    <script type="text/html" id="tmpl-bp-messages-feedback">
    	<div class="bp-feedback {{data.type}}">
    		<span class="bp-icon" aria-hidden="true"></span>
    		<p>{{{data.message}}}</p>
    	</div>
    </script>
    
    <?php
    /**
     * This view is used to inject hooks buffer
     */
    ?>
    <script type="text/html" id="tmpl-bp-messages-hook">
    	{{{data.extraContent}}}
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-form">
    	<?php bp_nouveau_messages_hook( 'before', 'compose_content' ); ?>
    
    	<label for="send-to-input"><?php esc_html_e( 'Send @Username', 'buddypress' ); ?></label>
    	<input type="text" name="send_to" class="send-to-input" id="send-to-input" />
    
    	<label for="subject"><?php _e( 'Subject', 'buddypress' ); ?></label>
    	<input type="text" name="subject" id="subject"/>
    
    	<div id="bp-message-content"></div>
    
    	<?php bp_nouveau_messages_hook( 'after', 'compose_content' ); ?>
    
    	<div class="submit">
    		<input type="button" id="bp-messages-send" class="button bp-primary-action" value="<?php echo esc_attr_x( 'Send', 'button', 'buddypress' ); ?>"/>
    		<input type="button" id="bp-messages-reset" class="text-button small bp-secondary-action" value="<?php echo esc_attr_x( 'Reset', 'form reset button', 'buddypress' ); ?>"/>
    	</div>
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-editor">
    	<?php
    	// Add a temporary filter on editor buttons
    	add_filter( 'mce_buttons', 'bp_nouveau_messages_mce_buttons', 10, 1 );
    
    	wp_editor(
    		'',
    		'message_content',
    		array(
    			'textarea_name' => 'message_content',
    			'teeny'         => false,
    			'media_buttons' => false,
    			'dfw'           => false,
    			'tinymce'       => true,
    			'quicktags'     => false,
    			'tabindex'      => '3',
    			'textarea_rows' => 5,
    		)
    	);
    
    	// Remove the temporary filter on editor buttons
    	remove_filter( 'mce_buttons', 'bp_nouveau_messages_mce_buttons', 10, 1 );
    	?>
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-paginate">
    	<# if ( 1 !== data.page ) { #>
    		<button id="bp-messages-prev-page"class="button messages-button">
    			<span class="dashicons dashicons-arrow-left"></span>
    			<span class="bp-screen-reader-text"><?php echo esc_html_x( 'Previous page', 'link', 'buddypress' ); ?></span>
    		</button>
    	<# } #>
    
    	<# if ( data.total_page !== data.page ) { #>
    		<button id="bp-messages-next-page"class="button messages-button">
    			<span class="dashicons dashicons-arrow-right"></span>
    			<span class="bp-screen-reader-text"><?php echo esc_html_x( 'Next page', 'link', 'buddypress' ); ?></span>
    		</button>
    	<# } #>
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-filters">
    	<li class="user-messages-search" role="search" data-bp-search="{{data.box}}">
    		<div class="bp-search messages-search">
    			<?php bp_nouveau_message_search_form(); ?>
    		</div>
    	</li>
    	<li class="user-messages-bulk-actions"></li>
    </script>
    
    <script type="text/html" id="tmpl-bp-bulk-actions">
    	<input type="checkbox" id="user_messages_select_all" value="1"/>
    	<label for="user_messages_select_all"><?php esc_html_e( 'All Messages', 'buddypress' ); ?></label>
    	<div class="bulk-actions-wrap bp-hide">
    		<div class="bulk-actions select-wrap">
    			<label for="user-messages-bulk-actions" class="bp-screen-reader-text">
    				<?php esc_html_e( 'Select bulk action', 'buddypress' ); ?>
    			</label>
    			<select id="user-messages-bulk-actions">
    				<# for ( i in data ) { #>
    					<option value="{{data[i].value}}">{{data[i].label}}</option>
    				<# } #>
    			</select>
    			<span class="select-arrow" aria-hidden="true"></span>
    		</div>
    		<button class="messages-button bulk-apply bp-tooltip" type="submit" data-bp-tooltip="<?php echo esc_attr_x( 'Apply', 'button', 'buddypress' ); ?>">
    			<span class="dashicons dashicons-yes" aria-hidden="true"></span>
    			<span class="bp-screen-reader-text"><?php echo esc_html_x( 'Apply', 'button', 'buddypress' ); ?></span>
    		</button>
    	</div>
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-thread">
    	<div class="thread-cb">
    		<input class="message-check" type="checkbox" name="message_ids[]" id="bp-message-thread-{{data.id}}" value="{{data.id}}">
    		<label for="bp-message-thread-{{data.id}}" class="bp-screen-reader-text"><?php esc_html_e( 'Select message:', 'buddypress' ); ?> {{data.subject}}</label>
    	</div>
    
    	<# if ( ! data.recipientsCount ) { #>
    		<div class="thread-from">
    			<a class="user-link" href="{{data.sender_link}}">
    				<img class="avatar" src="{{data.sender_avatar}}" alt="" />
    				<span class="bp-screen-reader-text"><?php esc_html_e( 'From:', 'buddypress' ); ?></span>
    				<span class="user-name">{{data.sender_name}}</span>
    			</a>
    		</div>
    	<# } else {
    		var recipient = _.first( data.recipients );
    		#>
    		<div class="thread-to">
    			<a class="user-link" href="{{recipient.user_link}}">
    				<img class="avatar" src="{{recipient.avatar}}" alt="" />
    				<span class="bp-screen-reader-text"><?php esc_html_e( 'To:', 'buddypress' ); ?></span>
    				<span class="user-name">{{recipient.user_name}}</span>
    			</a>
    
    			<# if ( data.toOthers ) { #>
    				<span class="num-recipients">{{data.toOthers}}</span>
    			<# } #>
    		</div>
    	<# } #>
    
    	<div class="thread-content" data-thread-id="{{data.id}}">
    		<div class="thread-subject">
    			<span class="thread-count">({{data.count}})</span>
    			<a class="subject" href="../view/{{data.id}}/">{{data.subject}}</a>
    		</div>
    		<p class="excerpt">{{data.excerpt}}</p>
    	</div>
    	<div class="thread-date">
    		<time datetime="{{data.date.toISOString()}}">{{data.display_date}}</time>
    	</div>
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-preview">
    	<# if ( undefined !== data.content ) { #>
    
    		<h2 class="message-title preview-thread-title"><?php esc_html_e( 'Active conversation:', 'buddypress' ); ?><span class="messages-title">{{{data.subject}}}</span></h2>
    		<div class="preview-content">
    			<header class="preview-pane-header">
    
    				<# if ( undefined !== data.recipients ) { #>
    					<dl class="thread-participants">
    						<dt><?php esc_html_e( 'Participants:', 'buddypress' ); ?></dt>
    						<dd>
    							<ul class="participants-list">
    								<# for ( i in data.recipients ) { #>
    									<li><a href="{{data.recipients[i].user_link}}" class="bp-tooltip" data-bp-tooltip="{{data.recipients[i].user_name}}"><img class="avatar mini" src="{{data.recipients[i].avatar}}" alt="{{data.recipients[i].user_name}}" /></a></li>
    								<# } #>
    							</ul>
    						</dd>
    					</dl>
    				<# } #>
    
    				<div class="actions">
    					<?php if(current_user_can('manage_options')){ ?>
    
    					<button type="button" class="message-action-delete bp-tooltip bp-icons" data-bp-action="delete" data-bp-tooltip="<?php esc_attr_e( 'Delete conversation.', 'buddypress' ); ?>">
    						<span class="bp-screen-reader-text"><?php esc_html_e( 'Delete conversation.', 'buddypress' ); ?></span>
    					</button>
    				<?php }?>
    
    					<# if ( undefined !== data.star_link ) { #>
    
    						<# if ( false !== data.is_starred ) { #>
    							<a role="button" class="message-action-unstar bp-tooltip bp-icons" href="{{data.star_link}}" data-bp-action="unstar" aria-pressed="true" data-bp-tooltip="<?php esc_attr_e( 'Unstar Conversation', 'buddypress' ); ?>">
    								<span class="bp-screen-reader-text"><?php esc_html_e( 'Unstar Conversation', 'buddypress' ); ?></span>
    							</a>
    						<# } else { #>
    							<a role="button" class="message-action-star bp-tooltip bp-icons" href="{{data.star_link}}" data-bp-action="star" aria-pressed="false" data-bp-tooltip="<?php esc_attr_e( 'Star Conversation', 'buddypress' ); ?>">
    								<span class="bp-screen-reader-text"><?php esc_html_e( 'Star Conversation', 'buddypress' ); ?></span>
    							</a>
    						<# } #>
    
    					<# } #>
    
    					<a href="../view/{{data.id}}/" class="message-action-view bp-tooltip bp-icons" data-bp-action="view" data-bp-tooltip="<?php esc_attr_e( 'View full conversation and reply.', 'buddypress' ); ?>">
    						<span class="bp-screen-reader-text"><?php esc_html_e( 'View full conversation and reply.', 'buddypress' ); ?></span>
    					</a>
    
    					<# if ( data.threadOptions ) { #>
    						<span class="bp-messages-hook thread-options">
    							{{{data.threadOptions}}}
    						</span>
    					<# } #>
    				</div>
    			</header>
    
    			<div class='preview-message'>
    				{{{data.content}}}
    			</div>
    
    			<# if ( data.inboxListItem ) { #>
    				<table class="bp-messages-hook inbox-list-item">
    					<tbody>
    						<tr>{{{data.inboxListItem}}}</tr>
    					</tbody>
    				</table>
    			<# } #>
    		</div>
    	<# } #>
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-single-header">
    	<h2 id="message-subject" class="message-title single-thread-title">{{{data.subject}}}</h2>
    	<header class="single-message-thread-header">
    		<# if ( undefined !== data.recipients ) { #>
    			<dl class="thread-participants">
    				<dt><?php esc_html_e( 'Participants:', 'buddypress' ); ?></dt>
    				<dd>
    					<ul class="participants-list">
    						<# for ( i in data.recipients ) { #>
    							<li><a href="{{data.recipients[i].user_link}}" class="bp-tooltip" data-bp-tooltip="{{data.recipients[i].user_name}}"><img class="avatar mini" src="{{data.recipients[i].avatar}}" alt="{{data.recipients[i].user_name}}" /></a></li>
    						<# } #>
    					</ul>
    				</dd>
    			</dl>
    		<# } #>
    
    		<div class="actions">
    					<?php if(current_user_can('manage_options')){ ?>
    
    			<button type="button" class="message-action-delete bp-tooltip bp-icons" data-bp-action="delete" data-bp-tooltip="<?php esc_attr_e( 'Delete conversation.', 'buddypress' ); ?>">
    				<span class="bp-screen-reader-text"><?php esc_html_e( 'Delete conversation.', 'buddypress' ); ?></span>
    			</button>
    <?php }?>
    		</div>
    	</header>
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-single-list">
    	<div class="message-metadata">
    		<# if ( data.beforeMeta ) { #>
    			<div class="bp-messages-hook before-message-meta">{{{data.beforeMeta}}}</div>
    		<# } #>
    
    		<a href="{{data.sender_link}}" class="user-link">
    			<img class="avatar" src="{{data.sender_avatar}}" alt="" />
    			<strong>{{data.sender_name}}</strong>
    		</a>
    
    		<time datetime="{{data.date.toISOString()}}" class="activity">{{data.display_date}}</time>
    
    		<div class="actions">
    			<# if ( undefined !== data.star_link ) { #>
    
    				<button type="button" class="message-action-unstar bp-tooltip bp-icons <# if ( false === data.is_starred ) { #>bp-hide<# } #>" data-bp-star-link="{{data.star_link}}" data-bp-action="unstar" data-bp-tooltip="<?php esc_attr_e( 'Unstar Message', 'buddypress' ); ?>">
    					<span class="bp-screen-reader-text"><?php esc_html_e( 'Unstar Message', 'buddypress' ); ?></span>
    				</button>
    
    				<button type="button" class="message-action-star bp-tooltip bp-icons <# if ( false !== data.is_starred ) { #>bp-hide<# } #>" data-bp-star-link="{{data.star_link}}" data-bp-action="star" data-bp-tooltip="<?php esc_attr_e( 'Star Message', 'buddypress' ); ?>">
    					<span class="bp-screen-reader-text"><?php esc_html_e( 'Star Message', 'buddypress' ); ?></span>
    				</button>
    
    			<# } #>
    		</div>
    
    		<# if ( data.afterMeta ) { #>
    			<div class="bp-messages-hook after-message-meta">{{{data.afterMeta}}}</div>
    		<# } #>
    	</div>
    
    	<# if ( data.beforeContent ) { #>
    		<div class="bp-messages-hook before-message-content">{{{data.beforeContent}}}</div>
    	<# } #>
    
    	<div class="message-content">{{{data.content}}}</div>
    
    	<# if ( data.afterContent ) { #>
    		<div class="bp-messages-hook after-message-content">{{{data.afterContent}}}</div>
    	<# } #>
    
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-single">
    	<?php bp_nouveau_messages_hook( 'before', 'thread_content' ); ?>
    
    	<div id="bp-message-thread-header" class="message-thread-header"></div>
    
    	<?php bp_nouveau_messages_hook( 'before', 'thread_list' ); ?>
    
    	<ul id="bp-message-thread-list"></ul>
    
    	<?php bp_nouveau_messages_hook( 'after', 'thread_list' ); ?>
    
    	<?php bp_nouveau_messages_hook( 'before', 'thread_reply' ); ?>
    
    	<form id="send-reply" class="standard-form send-reply">
    		<div class="message-box">
    			<div class="message-metadata">
    
    				<?php bp_nouveau_messages_hook( 'before', 'reply_meta' ); ?>
    
    				<div class="avatar-box">
    					<?php bp_loggedin_user_avatar( 'type=thumb&height=30&width=30' ); ?>
    
    					<strong><?php esc_html_e( 'Send a Reply', 'buddypress' ); ?></strong>
    				</div>
    
    				<?php bp_nouveau_messages_hook( 'after', 'reply_meta' ); ?>
    
    			</div><!-- .message-metadata -->
    
    			<div class="message-content">
    
    				<?php bp_nouveau_messages_hook( 'before', 'reply_box' ); ?>
    
    				<label for="message_content" class="bp-screen-reader-text"><?php _e( 'Reply to Message', 'buddypress' ); ?></label>
    				<div id="bp-message-content"></div>
    
    				<?php bp_nouveau_messages_hook( 'after', 'reply_box' ); ?>
    
    				<div class="submit">
    					<input type="submit" name="send" value="<?php echo esc_attr_x( 'Send Reply', 'button', 'buddypress' ); ?>" id="send_reply_button"/>
    				</div>
    
    			</div><!-- .message-content -->
    
    		</div><!-- .message-box -->
    	</form>
    
    	<?php bp_nouveau_messages_hook( 'after', 'thread_reply' ); ?>
    
    	<?php bp_nouveau_messages_hook( 'after', 'thread_content' ); ?>
    </script>

    Please use this file.

    Thanks

Viewing 25 results - 26 through 50 (of 231 total)
Skip to toolbar