Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • @matwin23

    Participant

    im not sure what you can change. Try disabling BP better message and see if it works…
    the other thing you could change is find this part of the code in the top shortcode section: ‘woocommerce_share’ and replace with ‘woocommerce_meta’

    other than that i dont have anything else…

    @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

    Found out it was WCFM causing the conflict but only when the user is subscribed as Store Vendor!

    hopefully the plugin developer can update to fix as its a massive vulnerability

    cheers

    @matwin23

    Participant

    I just switched theme in admin to legacy and private message is now working. Must be a Nouveau bug.

Viewing 4 replies - 1 through 4 (of 4 total)
Skip to toolbar