示例#1
0
文件: tags.php 项目: ecerta/webcomic
 /**
  * Render the description for a webcomic character.
  * 
  * <code class="php">
  * // render the description of a webcomic character on the character archive page
  * webcomic_character_description();
  * 
  * // assign the description of the webcomic character with an ID of 1 from collection 42 to a variable for later use
  * $description = WebcomicTag::webcomic_term_description( 1, 'webcomic42_character' );
  * </code>
  * 
  * <code class="bbcode">
  * // render the description of a webcomic character on the character archive page
  * [webcomic_character_description]
  * 
  * // render the description of the webcomic character with an ID of 1 from collection 42
  * [webcomic_character_description term="1" collection="webcomic42"]
  * </code>
  * 
  * @package Webcomic
  * @param integer $character Character ID to render a description for. Will use global term ID by default.
  * @param string $collection The collection the character belongs to.
  * @return string
  * @uses WebcomicTag::webcomic_term_description()
  */
 function webcomic_character_description($character = 0, $collection = '')
 {
     echo WebcomicTag::webcomic_term_description($character, $collection ? "{$collection}_character" : '');
 }
    ?>
				<?php 
    if (WebcomicTag::webcomic_term_image()) {
        ?>

					<div class="taxonomy-image"><?php 
        webcomic_character_avatar();
        ?>
</div><!-- .page-image -->

				<?php 
    }
    ?>

				<?php 
    if (WebcomicTag::webcomic_term_description()) {
        ?>

					<p><?php 
        webcomic_character_description();
        ?>
</p>

				<?php 
    }
    ?>
				<p>
				Apareceu pela primeira vez na página: <?php 
    first_webcomic_link('%link', '%title', get_queried_object()->term_id, false, 'character');
    ?>
 <br>
示例#3
0
 /**
  * Handle webcomic_(storyline|character)_description shortcode.
  * 
  * @param array $atts Shortcode attributes.
  * @param string $content Shortcode content.
  * @param string $name Shortcode name.
  * @return string
  * @uses WebcomicTag::webcomic_term_description()
  * @uses WebcomicTag::get_webcomic_collection()
  */
 public function webcomic_term_description($atts, $content, $name)
 {
     extract(shortcode_atts(array('term' => 0, 'collection' => ''), $atts));
     if (false !== strpos($name, 'storyline')) {
         $tax = 'storyline';
     } elseif (false !== strpos($name, 'character')) {
         $tax = 'character';
     } else {
         $tax = '';
     }
     return WebcomicTag::webcomic_term_description($term, $collection ? "{$collection}_{$tax}" : '');
 }