Last active
August 29, 2015 14:17
-
-
Save tomhodgins/4f390ea67e4ad412c122 to your computer and use it in GitHub Desktop.
Adding data-personas support to WordPres
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data-personas | |
data-default="<?php $dd = get_field_escaped($field); echo $dd; ?>" | |
<?php | |
$field = 'YourTagGoesHere'; | |
if(get_field($field . '_mm')) { | |
$mm = get_field_escaped($field . '_mm'); echo 'data-persona-marketing-maggie="' . $mm . '" '; | |
} else { | |
$mm = get_field_escaped($field); echo 'data-persona-marketing-maggie="' . $mm . '" '; | |
} | |
if(get_field($field . '_tt')) { | |
$tt = get_field_escaped($field . '_tt'); echo 'data-persona-technical-ty="' . $tt . '" '; | |
} else { | |
$tt = get_field_escaped($field); echo 'data-persona-technical-ty="' . $tt . '" '; | |
} | |
if(get_field($field . '_cc')) { | |
$cc = get_field_escaped($field . '_cc'); echo 'data-persona-content-charlie="' . $cc . '" '; | |
} else { | |
$cc = get_field_escaped($field); echo 'data-persona-content-charlie="' . $cc . '" '; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment