zeroality
03-19-2011, 12:45 AM
I found this:
$word = array(
'google',
'yahoo'
);
$link = array(
'<a href="http://google.com">google</a>',
'<a href="http://yahoo.com">yahoo</a>'
);
$this->post['message'] = str_replace($word, $link, $this->post['message']);
from a 3.5.x modification that does exactly what I wanted to do on my forums. I wanted to replace a word with another (a bunch of them actually) in existing posts.
Just not sure which hook I should use when creating a new plugin. I've never done a custom plugin for 4.x before. Thanks!
$word = array(
'google',
'yahoo'
);
$link = array(
'<a href="http://google.com">google</a>',
'<a href="http://yahoo.com">yahoo</a>'
);
$this->post['message'] = str_replace($word, $link, $this->post['message']);
from a 3.5.x modification that does exactly what I wanted to do on my forums. I wanted to replace a word with another (a bunch of them actually) in existing posts.
Just not sure which hook I should use when creating a new plugin. I've never done a custom plugin for 4.x before. Thanks!