<?php PLS_Taxonomy::init(); class PLS_Taxonomy { static $custom_meta = array(); public static function init() { add_action('init', array(__CLASS__, 'metadata_customizations')); } public static function get($args = array()) { $cache = new PLS_Cache('nbh'); if ($result = $cache->get($args)) { return $result; } extract(self::process_args($args), EXTR_SKIP); $subject = array(); if ($street) { $subject += array('taxonomy' => 'street', 'term' => $street, 'api_field' => 'address'); } elseif ($neighborhood) { $subject += array('taxonomy' => 'neighborhood', 'term' => $neighborhood, 'api_field' => 'neighborhood'); } elseif ($zip) { $subject += array('taxonomy' => 'zip', 'term' => $zip, 'api_field' => 'postal'); } elseif ($city) { $subject += array('taxonomy' => 'city', 'term' => $city, 'api_field' => 'locality'); } elseif ($state) { $subject += array('taxonomy' => 'state', 'term' => $state, 'api_field' => 'region'); } $term = get_term_by('slug', $subject['term'], $subject['taxonomy'], ARRAY_A); $custom_data = array();
<?php // // PLS_Taxonomy::add_meta('type', 'key', 'label'); // to retrieve: // get_tax_meta('tax_id', 'key_name'); PLS_Taxonomy::add_meta('text', 'one-sentesnce', 'One Sentence Description'); PLS_Taxonomy::add_meta('text', 'another', 'Another'); PLS_Taxonomy::add_meta('image', 'color_field_id', 'COlor Picker');
<?php global $query_string; $args = wp_parse_args($query_string, array('', 'state' => false, 'city' => false, 'neighborhood' => false, 'zip' => false, 'street' => false, 'image_limit' => 20)); $taxonomy = PLS_Taxonomy::get($args); ?> <div id="main_content"class="grid_8 alpha" role="main"> <div class="wrapper"> <div class="title-information"> <h1>Neighborhood Information for <?php echo $taxonomy['name']; ?> </h1> <?php if (isset($taxonomy['one-sentance'])) { ?> <h3><?php echo $taxonomy['one-sentance']; ?> </h3> <?php } ?> <h3><?php echo $taxonomy['another']; ?> </h3> </div> <div class="map polygon-too">