I have WordPress site. So I make code to convert title of post to english from arabic but the code get the title of post from WordPress.
I use plugin All in one SEO pack. So I add title to plugin on every page, not title of post but title in input All in one SEO pack.
I want get the title of All in one SEO pack to convert it.
Here is code for convert title in functions.php
:
function arb2en_title($post=0)
{
$text = get_the_title($_aioseop_title);
/*
function arb2en_title($post=0)
{
$text = get_the_title($post);
*/
$arb_en_map=array(
'د'=>']',
'ج'=>'[',
'ح'=>'p',
'خ'=>'o',
'ه'=>'i',
'ع'=>'u',
'غ'=>'y',
'ف'=>'t',
'ق'=>'r',
'ث'=>'e',
'ص'=>'w',
'ض'=>'q',
'ش'=>'a',
'س'=>'s',
'ي'=>'d',
'ب'=>'f',
'ل'=>'g',
'ا'=>'h',
'ت'=>'j',
'ن'=>'k',
'م'=>'l',
'ك'=>';',
'ط'=>'\'',
'ظ'=>'/',
'ز'=>'.',
'و'=>',',
'ة'=>'m',
'ى'=>'n',
'لا'=>'b',
'ر'=>'v',
'ؤ'=>'c',
'ء'=>'x',
'ئ'=>'z',
'إ'=>'Y',
'لإ'=>'T',
'لأ'=>'G',
'أ'=>'H',
'لآ'=>'B',
'آ'=>'N'
);
foreach($arb_en_map as $key=>$value)
{
$text=preg_replace("/$key/",$value,$text);
}
return htmlentities($text);
}
This code get title of post but I need get title in input All in one SEO pack. How can I do that?