Advertisement
Guest User

Juozas

a guest
Oct 31st, 2011
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.56 KB | None | 0 0
  1. // 1. Insert before the_content() function:
  2.  
  3. private function cleanReplace($find, $replace, $string){
  4.     for($i=0; $i < count($find); $i++)
  5.         $string = substr_replace($string, $replace[$i], strpos($string, $find[$i]), strlen($find[$i]));
  6.     return $string;
  7. }
  8.  
  9. // 2. Insert after 'for ($i = 0; $i < count($matches); $i++) {}' loop in the_content() function:
  10.  
  11. $content = $this->cleanReplace($find,$replace,$content);
  12.  
  13. // 3. Instead of str_replace($find, $replace, $content) in the 'else { switch ( $this->options['position'] ) {... } }' statement simply use:
  14.  
  15. $content
  16.  
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement