Home Forums Plugin Support WP Project Manager Pro Clickable URL's in Messages

This topic is: resolved

This topic contains 4 replies, has 3 voices, and was last updated by  Mahi 5 years, 9 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #3887

    helpfulnerd
    Participant
    Post count: 2

    Hi everyone

    I'm using this plugin for one of my projects and my client asked me to add the ability to have the URL's that are put into messages be automatically linked inside the message box.

    I have added the following code:
    $pattern = “/\[link\=(.*)\](.*)\[\/link\]/i”;
    $replace = “$2“;
    echo preg_replace($pattern, $replace, $subject);

    and it does work inside a comment to the message, but it does not work in the message box when you first create a message.

    Anyone have any ideas. A file perhaps that I also need to add the above code, or an entirely different code snippet?

    Any thoughts are greatly appreciated.

    #3895

    Tareq Hasan
    Keymaster
    Post count: 2831

    You don't need any regex, just use this single line:
    [php]add_filter( ‘cpm_get_content', ‘make_clickable' );[/php]

    #3897

    helpfulnerd
    Participant
    Post count: 2

    Where do I add that code? Do I add that in the CPM.php file?

    Thanks

    #3898

    helpfulnerd
    Participant
    Post count: 2

    Nevermind. I added this code to CPM.php and everything is working. Thanks

    #3900

    Mahi
    Member
    Post count: 1555

    Glad to know it solved. Cheers.

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Clickable URL's in Messages’ is closed to new replies.