Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'private message button'

Viewing 25 results - 26 through 50 (of 232 total)
  • Author
    Search Results
  • #310679
    fra88
    Participant

    Hi!
    How can I create a button on member’s profile that redirects to sending an automatic private message to their inbox. For example: a button : “I’m interested” sends the automatic private message: “I’m interested” to that member.
    Thanks!

    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!

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