Skip to content
Snippets Groups Projects
Commit db705537 authored by Erick Hitter's avatar Erick Hitter
Browse files

Reduce repetition by mapping HeadSpace2 postmeta keys to their equivalent meta names

parent 67363557
Branches
No related tags found
1 merge request!1Basic support
......@@ -55,6 +55,11 @@ class ETH_Escape_HeadSpace2 {
'_headspace_noydir',
);
private $hs_keys_to_meta_names = array(
'_headspace_description' => 'description',
'_headspace_metakey' => 'keywords',
);
/**
* Register plugin's hooks
*
......@@ -96,11 +101,8 @@ class ETH_Escape_HeadSpace2 {
foreach ( $hs_data as $hs_key => $hs_value ) {
switch( $hs_key ) {
case '_headspace_description' :
echo '<meta name="description" content="' . esc_attr( $hs_value ) . '" />' . "\n";
break;
case '_headspace_metakey' :
echo '<meta name="keywords" content="' . esc_attr( $hs_value ) . '" />' . "\n";
echo '<meta name="' . esc_attr( $this->hs_keys_to_meta_names[ $hs_key ] ) . '" content="' . esc_attr( $hs_value ) . '" />' . "\n";
break;
default :
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment