Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function keyword_shortcode($atts, $content = null) {
- $custom_factions = array("Chapter", "Legion", "Regiment", "Craftworld", "Masque", "Clan", "Order", "Sept", "Hive Fleet", "Dynasty", "Kabal", "Haemonculus Coven", "Wych Cult", "Ordo");
- if (!empty($content)) {
- $titlecased_content = ucwords(strtolower($content));
- if (in_array($titlecased_content, $custom_factions)) {
- return '<span style="font-variant: small-caps; font-weight: bold;"><' . $titlecased_content . '></span>';
- } else {
- return '<span style="font-variant: small-caps; font-weight: bold;">' . $titlecased_content . '</span>';
- }
- } else {
- return '';
- }
- }
- add_shortcode('kw', 'keyword_shortcode');
- ?>
Add Comment
Please, Sign In to add comment