Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Shamim Hasan

    (@shamim51)

    you can copy post link and paste into message.
    or you can follow https://www.shamimsplugins.com/support/topic/page-url-in-message/#post-8904

    Thread Starter joropress

    (@joropress)

    Thank you – this works for me, but what should I add/change in this code in order to automatically add the post title as a title of the link to the post? I need to replace “Link-to-the-post” with the actual post title in this snippet:

    add_filter( 'fep_filter_message_before_send', 'fep_cus_send_url', 999 );
    
    function fep_cus_send_url( $message ) {
        if( empty( $message['message_content'] ) || $message['post_parent'] )
        return $message;
    
        $message['message_content'] .= '<blockquote class="wp-embedded-content">';
        $message['message_content'] .= '<a href="';
        $message['message_content'] .= esc_url( $_SERVER['HTTP_REFERER'] );
        $message['message_content'] .= '" target="_blank">Link-to the-post</a>';
        $message['message_content'] .= '</blockquote>';
        
        return $message;
    }
    Plugin Author Shamim Hasan

    (@shamim51)

    By default from that shortcode message_title is post title. So you can use $message['message_title'] instead of Link-to the-post

    Thread Starter joropress

    (@joropress)

    Thank you very much! Excellent support! Resolved!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Embed link to message’ is closed to new replies.