Skip to content

Commit

Permalink
Separate `Alayhi s-salām from SAW
Browse files Browse the repository at this point in the history
  • Loading branch information
azizur committed Dec 30, 2013
1 parent 6057f88 commit 4bddbed
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Supported Short Codes:
|:-:|:-:|---:|---|---|
| [basmala]<br />[bismillah] | &#65021; | &#1576;&#1587;&#1605; &#1575;&#1604;&#1604;&#1607; &#1575;&#1604;&#1585;&#1581;&#1605;&#1606; &#1575;&#1604;&#1585;&#1581;&#1610;&#1605; | bismi-llāhi r-raḥmāni r-raḥīm | In the name of God, most Gracious, most Compassionate |
| [pbuh]<br />[saw]<br />[saaw]<br />[saas]<br />[saww] | &#65018; | &#1589;&#1604;&#1609; &#1575;&#1604;&#1604;&#1607; &#1593;&#1604;&#1610;&#1607; &#1608; &#1587;&#1604;&#1605; | ṣall Allāhu ʿalay-hi wa-sallam | May Allāh honor him and grant him peace |
| [sa]<br />[alayhis] | &#1593;&#1604;&#1610;&#1607; &#1575;&#1604;&#1587;&#1604;&#1575;&#1605; | &#1593;&#1604;&#1610;&#1607; &#1575;&#1604;&#1587;&#1604;&#1575;&#1605; | `Alayhi s-salām | Upon Him/Her Be Peace |
| [as]<br />[alayhis] | &#1593;&#1604;&#1610;&#1607; &#1575;&#1604;&#1587;&#1604;&#1575;&#1605; | &#1593;&#1604;&#1610;&#1607; &#1575;&#1604;&#1587;&#1604;&#1575;&#1605; | `Alayhi s-salām | Upon Him/Her Be Peace |
| [rahimaha] | | | | |
| [rahimahu] | | | | |
| [rahimahum] | | | | |
Expand All @@ -18,6 +18,6 @@ Supported Short Codes:
| [ranhu] | | | | |
| [ranhum] | | | | |
| [salaam]<br />[sallam] | &#1575;&#1604;&#1587;&#1604;&#1575;&#1605; &#1593;&#1604;&#1610;&#1603;&#1605; | &#1575;&#1604;&#1587;&#1604;&#1575;&#1605; &#1593;&#1604;&#1610;&#1603;&#1605; | As-salamu alaykum | Peace be upon you |
| [wasallam]<br />[waalaykumu] | &#1608;&#1593;&#1604;&#1610;&#1603;&#1605; &#1575;&#1604;&#1587;&#1604;&#1575;&#1605; | &#1608;&#1593;&#1604;&#1610;&#1603;&#1605; &#1575;&#1604;&#1587;&#1604;&#1575;&#1605; | Wa ‘alaykum al-salaam | And unto you peace |
| [wasalaam]<br />[wasallam]<br />[waalaykumu] | &#1608;&#1593;&#1604;&#1610;&#1603;&#1605; &#1575;&#1604;&#1587;&#1604;&#1575;&#1605; | &#1608;&#1593;&#1604;&#1610;&#1603;&#1605; &#1575;&#1604;&#1587;&#1604;&#1575;&#1605; | Wa ‘alaykum al-salaam | And unto you peace |
| [allah] | &#65010; | &#65010; | Allāh | Allah (God) |
| [swt]<br />[jallajalaluh]<br />[jallajalalouhou] | &#xFDFB; | &#1587;&#1576;&#1581;&#1575;&#1606;&#1607; &#1608; &#1578;&#1593;&#1575;&#1604;&#1609; | Jalla Jalāluhu | May He be Glorified and Exalted |
23 changes: 20 additions & 3 deletions arabic-ligature.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class arabic_ligature {
'In the name of God, most Gracious, most Compassionate'
),
array( // sallallahou alayhe wasallam
array('pbuh', 'saw', 'saaw', 'saas', 'saww', 'alayhis'),
array('pbuh', 'saw', 'saaw', 'saas', 'saww'),
array('U+FDFA','&#65018;','&#xFDFA;','%EF%B7%BA'),
'&#1589;&#1604;&#1609; &#1575;&#1604;&#1604;&#1607; &#1593;&#1604;&#1610;&#1607; &#1608;&#1587;&#1604;&#1605;&#8206;',
'ṣall Allāhu ʿalay-hi wa-sallam',
Expand All @@ -73,6 +73,13 @@ class arabic_ligature {
'As-salamu alaykum',
'Peace be upon you'
),
array( // `Alayhi s-salām
array('sa', 'alayhis'),
array('U+FDFA','&#65018;','&#xFDFA;','%EF%B7%BA'),
'&#1589;&#1604;&#1609; &#1575;&#1604;&#1604;&#1607; &#1593;&#1604;&#1610;&#1607; &#1608;&#1587;&#1604;&#1605;&#8206;',
'ʿalay-hi wa-sallam',
'May Allāh honor him and grant him peace'
),
);

function __construct() {
Expand All @@ -82,7 +89,17 @@ function __construct() {

private function _register_filters() {
add_filter( 'wp_title', array($this, 'filter_wp_title'), 100);
add_filter( 'the_content', array($this, 'filter_the_content'), 20 );
add_filter( 'the_content', array($this, 'filter_the_content'), 20);
// add_action( 'wp_head', array($this, 'style'));
}

public function style() {
$style = '<style>';
$style .= '.arabic-ligature {';
$style .= ' font-family: "Times New Roman", sans-serif;';
$style .= '}';
$style .= '</style>';
echo $style;
}

public function filter_wp_title($title) {
Expand All @@ -100,7 +117,7 @@ public function filter_the_content($content) {
foreach($this->_ligature_map as $shortcode=>$data) {
$pattern[] = "/\[$shortcode\]/im";
$replacement[] = sprintf(
'<span title="%s (%s) %s">%s</span>',
'<span class="arabic-ligature" title="%s (%s) %s">%s</span>',
$data['arabic'],
$data['transliteration'],
$data['translation'],
Expand Down

0 comments on commit 4bddbed

Please sign in to comment.