Skip to content
Browse files

Removed get_webcomic_post_terms()

The internal function get_the_terms() now makes this function
redundant, so all calls to get_webcomic_post_terms() have been swapped
for the built-in get_the_terms(). The template tags that referenced
get_webcomic_post_terms() have been marked as deprecated for the next
point release.
  • Loading branch information...
1 parent 6d1c983 commit ba4da970eb25e41a671214700e9cfd84ca4a046d Michael Sisk committed Sep 21, 2011
Showing with 6 additions and 39 deletions.
  1. +5 −4 webcomic-includes/tags.php
  2. +1 −35 webcomic.php
View
9 webcomic-includes/tags.php
@@ -57,7 +57,6 @@ function webcomic_transcribe_form_languages() { global $webcomic; echo $webcomic
function webcomic_transcript_info( $i = false ) { global $webcomic; echo $webcomic->get_webcomic_transcript_info( $i ); }
function webcomic_transcript_class( $class = false ) { global $webcomic; echo $webcomic->get_webcomic_transcript_class( $class ); }
function in_webcomic_collection( $terms = false, $id = false ) { global $webcomic; return $webcomic->in_webcomic_term( 'webcomic_collection', $terms, $id ); }
-function get_webcomic_post_collections( $id = false ) { global $webcomic; return $webcomic->get_webcomic_post_terms( 'webcomic_collection', $id ); }
function the_webcomic_post_collections( $args = false ) { global $webcomic; echo $webcomic->get_the_webcomic_post_terms( 'webcomic_collection', $args ); }
function get_webcomic_collection_info( $i = false, $term = false ) { global $webcomic; echo $webcomic->get_webcomic_term_info( $i, 'webcomic_collection', $term ); }
function the_webcomic_collections( $args = false ) { global $webcomic; echo $webcomic->get_the_webcomic_terms( 'webcomic_collection', $args ); }
@@ -72,7 +71,6 @@ function last_webcomic_collection_link( $format = '%link', $link = '%label', $te
function previous_webcomic_collection_link( $format = '%link', $link = '%label', $term = false, $orderby = false, $hide_empty = true ) { global $webcomic; echo $webcomic->get_relative_webcomic_term_link( 'previous', 'webcomic_collection', $format, $link, $term, $orderby, $hide_empty ); }
function next_webcomic_collection_link( $format = '%link', $link = '%label', $term = false, $orderby = false, $hide_empty = true ) { global $webcomic; echo $webcomic->get_relative_webcomic_term_link( 'next', 'webcomic_collection', $format, $link, $term, $orderby, $hide_empty ); }
function in_webcomic_storyline( $terms = false, $id = false ) { global $webcomic; return $webcomic->in_webcomic_term( 'webcomic_storyline', $terms, $id ); }
-function get_webcomic_post_storylines( $id = false ) { global $webcomic; return $webcomic->get_webcomic_post_terms( 'webcomic_storyline', $id ); }
function the_webcomic_post_storylines( $args = false ) { global $webcomic; echo $webcomic->get_the_webcomic_post_terms( 'webcomic_storyline', $args ); }
function get_webcomic_storyline_info( $i = false, $term = false ) { global $webcomic; echo $webcomic->get_webcomic_term_info( $i, 'webcomic_storyline', $term ); }
function the_webcomic_storylines( $args = false ) { global $webcomic; echo $webcomic->get_the_webcomic_terms( 'webcomic_storyline', $args ); }
@@ -87,7 +85,6 @@ function last_webcomic_storyline_link( $format = '%link', $link = '%label', $ter
function previous_webcomic_storyline_link( $format = '%link', $link = '%label', $term = false, $orderby = false, $hide_empty = true ) { global $webcomic; echo $webcomic->get_relative_webcomic_term_link( 'previous', 'webcomic_storyline', $format, $link, $term, $orderby, $hide_empty ); }
function next_webcomic_storyline_link( $format = '%link', $link = '%label', $term = false, $orderby = false, $hide_empty = true ) { global $webcomic; echo $webcomic->get_relative_webcomic_term_link( 'next', 'webcomic_storyline', $format, $link, $term, $orderby, $hide_empty ); }
function in_webcomic_character( $terms = false, $id = false ) { global $webcomic; return $webcomic->in_webcomic_term( 'webcomic_character', $terms, $id ); }
-function get_webcomic_post_characters( $id = false ) { global $webcomic; return $webcomic->get_webcomic_post_terms( 'webcomic_character', $id ); }
function the_webcomic_post_characters( $args = false ) { global $webcomic; echo $webcomic->get_the_webcomic_post_terms( 'webcomic_character', $args ); }
function webcomic_character_info( $i = false, $term = false ) { global $webcomic; echo $webcomic->get_webcomic_term_info( $i, 'webcomic_character', $term ); }
function the_webcomic_characters( $args = false ) { global $webcomic; echo $webcomic->get_the_webcomic_terms( 'webcomic_character', $args ); }
@@ -102,4 +99,8 @@ function last_webcomic_character_link( $format = '%link', $link = '%label', $ter
function previous_webcomic_character_link( $format = '%link', $link = '%label', $term = false, $orderby = false, $hide_empty = true ) { global $webcomic; echo $webcomic->get_relative_webcomic_term_link( 'previous', 'webcomic_character', $format, $link, $term, $orderby, $hide_empty ); }
function next_webcomic_character_link( $format = '%link', $link = '%label', $term = false, $orderby = false, $hide_empty = true ) { global $webcomic; echo $webcomic->get_relative_webcomic_term_link( 'next', 'webcomic_character', $format, $link, $term, $orderby, $hide_empty ); }
function webcomic_archive( $args = false ) { global $webcomic; echo $webcomic->get_the_webcomic_archive( $args ); }
-?>
+
+/* Deprecated */
+function get_webcomic_post_collections( $id = false ) { return get_the_terms( $id, 'webcomic_collection' ); }
+function get_webcomic_post_storylines( $id = false ) { return get_the_terms( $id, 'webcomic_storyline' ); }
+function get_webcomic_post_characters( $id = false ) { return get_the_terms( $id, 'webcomic_character' ); }
View
36 webcomic.php
@@ -1686,40 +1686,6 @@ function get_webcomic_term_info( $i, $taxonomy, $term = false ) {
}
/**
- * Returns terms related to the specified post in the specified taxonomy.
- *
- * Although technically generic, we alway return false
- * if the specified taxonomy is not a Webcomic taxonomy.
- *
- * @package webcomic
- * @since 3
- */
- function get_webcomic_post_terms( $taxonomy, $id = false ) {
- if ( !( 'webcomic_collection' == $taxonomy || 'webcomic_storyline' == $taxonomy || 'webcomic_character' == $taxonomy ) )
- return false;
-
- global $post;
-
- $id = ( intval( $id ) > 0 ) ? $id : $post->ID;
- $terms = get_object_term_cache( $id, $taxonomy );
-
- if ( false === $terms ) {
- $terms = wp_get_object_terms( $id, $taxonomy );
- wp_cache_add( $id, $terms, $taxonomy . '_post_relationships' );
- }
-
- if ( !empty( $terms ) ) {
- if ( 'webcomic_storyline' == $taxonomy )
- usort( $terms, array( &$this, 'usort_storylines' ) );
- else
- usort( $terms, '_usort_terms_by_name' );
- } else
- $terms = array();
-
- return apply_filters( 'webcomic_get_post_terms', $terms, $taxonomy, $id );
- }
-
- /**
* Returns a formatted list of terms related to the specified object in the specified taxonomy.
*
* @package webcomic
@@ -1746,7 +1712,7 @@ function get_the_webcomic_post_terms( $taxonomy, $args = false ) {
'id' => false //int ID of the object to retrieve terms for.
); $args = wp_parse_args( $args, $defaults ); extract( $args );
- $terms = $this->get_webcomic_post_terms( $taxonomy, $id );
+ $terms = get_the_terms( $id, $taxonomy );
if ( empty( $terms ) || !$this->verify() )
return false;

0 comments on commit ba4da97

Please sign in to comment.
Something went wrong with that request. Please try again.