Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
WP Plugins
ETH Escape Headspace
Commits
cbcea871
Commit
cbcea871
authored
Jan 30, 2016
by
Erick Hitter
Browse files
Retreive supported keys and begin approach to build output
parent
b8bbfb6c
Changes
1
Show whitespace changes
Inline
Side-by-side
eth-escape-headspace.php
View file @
cbcea871
...
@@ -40,12 +40,56 @@ class ETH_Escape_HeadSpace2 {
...
@@ -40,12 +40,56 @@ class ETH_Escape_HeadSpace2 {
}
}
/**
/**
* Register actions and filters
* Class properties
*/
private
$hs_keys
=
array
(
'_headspace_description'
,
'_headspace_metakey'
,
'_headspace_noindex'
,
);
/**
* Register plugin's hooks
*
*
* @return null
* @return null
*/
*/
private
function
__construct
()
{
private
function
__construct
()
{
//
add_action
(
'wp_head'
,
array
(
$this
,
'action_wp_head'
)
);
}
/**
*
*/
public
function
action_wp_head
()
{
// Applies only to individual post objects
if
(
!
is_singular
()
)
{
return
;
}
// Check for HS data
$hs_data
=
array
();
foreach
(
$this
->
hs_keys
as
$hs_key
)
{
$value
=
get_post_meta
(
get_the_ID
(),
$hs_key
,
true
);
if
(
!
empty
(
$value
)
)
{
$hs_data
[
$hs_key
]
=
$value
;
}
}
// Bail if no HS data exists for this post
if
(
empty
(
$hs_data
)
)
{
return
;
}
// Build output
foreach
(
$hs_data
as
$hs_key
=>
$hs_value
)
{
switch
(
$hs_key
)
{
default
:
continue
;
break
;
}
}
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment