--- models/inline_tags.php.old 2009-08-07 09:14:49.047137500 +0100 +++ models/inline_tags.php 2009-08-07 09:12:18.914427000 +0100 @@ -160,6 +160,12 @@ if (strpos ($value, '%%tag_description%%') !== false) $value = str_replace ('%%tag_description%%', HS_InlineTags::get_tag_description ($post), $value); + if (strpos ($value, '%%term_description%%') !== false) + $value = str_replace ('%%term_description%%', HS_InlineTags::get_term_description (), $value); + + if (strpos ($value, '%%term_title%%') !== false) + $value = str_replace ('%%term_title%%', HS_InlineTags::get_term_title (), $value); + if (strpos ($value, '%%page%%') !== false) $value = str_replace ('%%page%%', HS_InlineTags::get_page ($post), $value); @@ -214,6 +220,52 @@ return ''; } + /** + * Return the current taxonomy term description + * + * @return string + **/ + + function get_term_description() { + + $taxonomy = get_query_var('taxonomy'); + $term = get_query_var('term'); + + if (function_exists ('get_term') && $taxonomy != '' && $term != '') { + + $term = get_term_by('slug', $term, $taxonomy); + + if ( is_wp_error($term) ) + return ''; + + return($term->description); + } + return ''; + } + + /** + * Return the current taxonomy term title * + * @return string + **/ + + function get_term_title() { + + $taxonomy = get_query_var('taxonomy'); + $term = get_query_var('term'); + + if (function_exists ('get_term') && $taxonomy != '' && $term != '') { + + $term = get_term_by('slug', $term, $taxonomy); + + if ( is_wp_error($term) ) + return ''; + + return($term->name); + } + return ''; + } + + /** * Return the current categories --- view/admin/help.php.old 2009-08-06 17:15:30.000000000 -0500 +++ view/admin/help.php 2009-08-06 17:12:44.000000000 -0500 @@ -16,6 +16,8 @@ 'category' => __( 'Replaced with the post categories (comma separated)', 'headspace'), 'category_description' => __( 'Replaced with the category description', 'headspace'), 'tag_description' => __( 'Replaced with the tag description', 'headspace'), + 'term_description' => __( 'Replaced with the term description', 'headspace'), + 'term_title' => __( 'Replaced with the term name', 'headspace'), 'modified' => __( 'Replaced with the post/page modified time', 'headspace'), 'id' => __( 'Replaced with the post/page ID', 'headspace'), 'name' => __( 'Replaced with the post/page author\'s \'nicename\'', 'headspace'), --- models/headspace.php.old 2009-08-18 13:51:58.000000000 -0500 +++ models/headspace.php 2009-08-18 13:48:14.000000000 -0500 @@ -92,6 +92,7 @@ 'global' => array (__ ('Global Settings', 'headspace'), __ ('applied to everything unless otherwise specified', 'headspace')), 'home' => array (__ ('Home Page', 'headspace'), __ ('applied to the home page (or blog page)', 'headspace')), 'front' => array (__ ('Front Page', 'headspace'), __('applied to front page (if you have set WordPress to use a static page)')), + 'taxonomy' => array (__ ('Taxonomy Archives', 'headspace'), __ ('applied when viewing a taxonomy archive', 'headspace')), 'archive' => array (__ ('Archives', 'headspace'), __ ('applied when viewing the archives', 'headspace')), 'category' => array (__ ('Categories', 'headspace'), __ ('applied to category pages without specific settings', 'headspace')), 'post' => array (__ ('Posts', 'headspace'), __ ('applied to posts without specific settings', 'headspace')), @@ -166,9 +167,12 @@ $meta[] = get_option ('headspace_search'); else if (is_tag ()) $meta[] = get_option ('headspace_tags'); - else if (is_archive ()) - $meta[] = get_option ('headspace_archive'); - else if (strpos ($_SERVER['REQUEST_URI'], 'wp-login.php') !== false) + else if (is_archive ()) { + if (is_tax()) + $meta[] = get_option ('headspace_taxonomy'); + else + $meta[] = get_option ('headspace_archive'); + } else if (strpos ($_SERVER['REQUEST_URI'], 'wp-login.php') !== false) $meta[] = get_option ('headspace_login'); else if (is_feed ()) { // Remove title from RSS