• Resolved horoshima

    (@horoshima)


    Hello

    I want the current page title or the post title to be the subject of the conversation when a user clic on the pm_button. Please how can i achieve that?

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter horoshima

    (@horoshima)

    please help me.

    Plugin Support Andrij Tkachenko

    (@andrijtkachenko)

    Hi there!

    Unfortunately there is no way to insert dynamic data to shortcodes at the moment, you will need to create your own shortcode to implement that, for example:

    add_shortcode( 'custom_pm_button', function () {
    $title = get_the_title();

    if( $title ){
    echo do_shortcode('[better_messages_pm_button text="Private Message" subject="' . esc_attr($title) . '" message="Lorem Ipsum is simply dummy text." target="_self" class="extra-class" fast_start="0" url_only="0"]');
    }
    });

    Then you can use [custom_pm_button] shortcode to place the shortcode with dynamic title at your pages.


    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.