hi ,
I want to create a plugin , I want it to replace some words and give it link like wikipidia .. or wiki site ..
for example when I write :"Japan or United State" directly the plugins search in DB about the post it title is "Japan" if it exsist give it link like this ' Japan ' also I try to make it without database by array but I can't
this is the code :
<?php
/*
Plugin Name: ReplaceMent
*/
$wiki_contry = array ("Japan"=>"<a href='?japan.php'> Japan <a/>","United State"=>"<a href='?usa.php'> United State <a/>");
function replace($text){
foreach ($wiki_contry as $ky => $vl){
$text = str_replace(ِ"$ky","$vl", $text);
return $text;
}
}
add_filter('the_content','replace');
?>
and the error is :
Parse error: parse error in C:\wamp\www\wordpress\wp-content\plugins\replace_plugins\replace_plugins.php on line 9
I wait you to help me , plz