Beispiel #1
0
 /**
  * Render the webcomic character name on a character archive page.
  * 
  * <code class="php">
  * // render the character name
  * webcomic_character_title();
  * 
  * // assign the title of the character with an id of 42 in the 'webcomic42' collection to a variable for later use
  * $character_title = WebcomicTag::webcomic_term_title( 'Character: ', 42, 'webcomic42' );
  * </code>
  * 
  * <code class="bbcode">
  * // render the character title
  * [webcomic_character_title]
  * 
  * // render the title of the character with an id of 1 in the 'webcomic42' collection with a prefix
  * [webcomic_character_title term="1" collection="webcomic42"]Character: [/webcomic_character_title]
  * </code>
  * 
  * @package Webcomic
  * @param string $prefix Content to display before the title.
  * @param mixed $character Character object or ID to render the title for. Will use global term ID by default.
  * @param string $collection The collection the character belongs to.
  * @uses WebcomicTag::webcomic_term_title()
  */
 function webcomic_character_title($prefix = '', $character = 0, $collection = '')
 {
     echo WebcomicTag::webcomic_term_title($prefix, $character, $collection ? "{$collection}_character" : '');
 }
Beispiel #2
0
 /**
  * Handle webcomic_(storyline|character)_title shortcode.
  * 
  * @param array $atts Shortcode attributes.
  * @param string $content Shortcode content.
  * @param string $name Shortcode name.
  * @return string
  * @uses WebcomicTag::webcomic_term_title()
  * @uses WebcomicTag::get_webcomic_collection()
  */
 public function webcomic_term_title($atts, $content, $name)
 {
     extract(shortcode_atts(array('prefix' => '', 'term' => 0, 'collection' => ''), $atts));
     if (false !== strpos($name, 'storyline')) {
         $tax = 'storyline';
     } elseif (false !== strpos($name, 'character')) {
         $tax = 'character';
     } else {
         $tax = '';
     }
     $prefix = $content ? do_shortcode($content) : $prefix;
     return WebcomicTag::webcomic_term_title($prefix, $term, $collection ? "{$collection}_{$tax}" : '');
 }