Skip to content
This repository
Browse code

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...
commit ba4da970eb25e41a671214700e9cfd84ca4a046d 1 parent 6d1c983
Michael Sisk authored

Showing 2 changed files with 6 additions and 39 deletions. Show diff stats Hide diff stats

  1. +5 4 webcomic-includes/tags.php
  2. +1 35 webcomic.php
9 webcomic-includes/tags.php
@@ -57,7 +57,6 @@ function webcomic_transcribe_form_languages() { global $webcomic; echo $webcomic
57 57 function webcomic_transcript_info( $i = false ) { global $webcomic; echo $webcomic->get_webcomic_transcript_info( $i ); }
58 58 function webcomic_transcript_class( $class = false ) { global $webcomic; echo $webcomic->get_webcomic_transcript_class( $class ); }
59 59 function in_webcomic_collection( $terms = false, $id = false ) { global $webcomic; return $webcomic->in_webcomic_term( 'webcomic_collection', $terms, $id ); }
60   -function get_webcomic_post_collections( $id = false ) { global $webcomic; return $webcomic->get_webcomic_post_terms( 'webcomic_collection', $id ); }
61 60 function the_webcomic_post_collections( $args = false ) { global $webcomic; echo $webcomic->get_the_webcomic_post_terms( 'webcomic_collection', $args ); }
62 61 function get_webcomic_collection_info( $i = false, $term = false ) { global $webcomic; echo $webcomic->get_webcomic_term_info( $i, 'webcomic_collection', $term ); }
63 62 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
72 71 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 ); }
73 72 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 ); }
74 73 function in_webcomic_storyline( $terms = false, $id = false ) { global $webcomic; return $webcomic->in_webcomic_term( 'webcomic_storyline', $terms, $id ); }
75   -function get_webcomic_post_storylines( $id = false ) { global $webcomic; return $webcomic->get_webcomic_post_terms( 'webcomic_storyline', $id ); }
76 74 function the_webcomic_post_storylines( $args = false ) { global $webcomic; echo $webcomic->get_the_webcomic_post_terms( 'webcomic_storyline', $args ); }
77 75 function get_webcomic_storyline_info( $i = false, $term = false ) { global $webcomic; echo $webcomic->get_webcomic_term_info( $i, 'webcomic_storyline', $term ); }
78 76 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
87 85 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 ); }
88 86 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 ); }
89 87 function in_webcomic_character( $terms = false, $id = false ) { global $webcomic; return $webcomic->in_webcomic_term( 'webcomic_character', $terms, $id ); }
90   -function get_webcomic_post_characters( $id = false ) { global $webcomic; return $webcomic->get_webcomic_post_terms( 'webcomic_character', $id ); }
91 88 function the_webcomic_post_characters( $args = false ) { global $webcomic; echo $webcomic->get_the_webcomic_post_terms( 'webcomic_character', $args ); }
92 89 function webcomic_character_info( $i = false, $term = false ) { global $webcomic; echo $webcomic->get_webcomic_term_info( $i, 'webcomic_character', $term ); }
93 90 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
102 99 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 ); }
103 100 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 ); }
104 101 function webcomic_archive( $args = false ) { global $webcomic; echo $webcomic->get_the_webcomic_archive( $args ); }
105   -?>
  102 +
  103 +/* Deprecated */
  104 +function get_webcomic_post_collections( $id = false ) { return get_the_terms( $id, 'webcomic_collection' ); }
  105 +function get_webcomic_post_storylines( $id = false ) { return get_the_terms( $id, 'webcomic_storyline' ); }
  106 +function get_webcomic_post_characters( $id = false ) { return get_the_terms( $id, 'webcomic_character' ); }
36 webcomic.php
@@ -1686,40 +1686,6 @@ function get_webcomic_term_info( $i, $taxonomy, $term = false ) {
1686 1686 }
1687 1687
1688 1688 /**
1689   - * Returns terms related to the specified post in the specified taxonomy.
1690   - *
1691   - * Although technically generic, we alway return false
1692   - * if the specified taxonomy is not a Webcomic taxonomy.
1693   - *
1694   - * @package webcomic
1695   - * @since 3
1696   - */
1697   - function get_webcomic_post_terms( $taxonomy, $id = false ) {
1698   - if ( !( 'webcomic_collection' == $taxonomy || 'webcomic_storyline' == $taxonomy || 'webcomic_character' == $taxonomy ) )
1699   - return false;
1700   -
1701   - global $post;
1702   -
1703   - $id = ( intval( $id ) > 0 ) ? $id : $post->ID;
1704   - $terms = get_object_term_cache( $id, $taxonomy );
1705   -
1706   - if ( false === $terms ) {
1707   - $terms = wp_get_object_terms( $id, $taxonomy );
1708   - wp_cache_add( $id, $terms, $taxonomy . '_post_relationships' );
1709   - }
1710   -
1711   - if ( !empty( $terms ) ) {
1712   - if ( 'webcomic_storyline' == $taxonomy )
1713   - usort( $terms, array( &$this, 'usort_storylines' ) );
1714   - else
1715   - usort( $terms, '_usort_terms_by_name' );
1716   - } else
1717   - $terms = array();
1718   -
1719   - return apply_filters( 'webcomic_get_post_terms', $terms, $taxonomy, $id );
1720   - }
1721   -
1722   - /**
1723 1689 * Returns a formatted list of terms related to the specified object in the specified taxonomy.
1724 1690 *
1725 1691 * @package webcomic
@@ -1746,7 +1712,7 @@ function get_the_webcomic_post_terms( $taxonomy, $args = false ) {
1746 1712 'id' => false //int ID of the object to retrieve terms for.
1747 1713 ); $args = wp_parse_args( $args, $defaults ); extract( $args );
1748 1714
1749   - $terms = $this->get_webcomic_post_terms( $taxonomy, $id );
  1715 + $terms = get_the_terms( $id, $taxonomy );
1750 1716
1751 1717 if ( empty( $terms ) || !$this->verify() )
1752 1718 return false;

0 comments on commit ba4da97

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