示例#1
0
文件: tags.php 项目: ecerta/webcomic
 /**
  * Return a crossover collection title.
  * 
  * @param string $prefix Content to display before the title.
  * @return string
  * @uses Webcomic::$config
  * @uses WebcomicTag::webcomic_collection_title()
  * @filter string webcomic_crossover_title Filters the output of `webcomic_crossover_title`.
  */
 public static function webcomic_crossover_title($prefix = '')
 {
     global $wp_query;
     if (is_tax() and $crossover = $wp_query->get('crossover')) {
         foreach (self::$config['collections'] as $k => $v) {
             if ($crossover === $v['slugs']['name']) {
                 return apply_filters('webcomic_crossover_title', WebcomicTag::webcomic_collection_title($prefix, $k), $prefix, $k);
             }
         }
     }
 }
示例#2
0
 /**
  * Handle webcomic_collection_title shortcode.
  * 
  * @param array $atts Shortcode attributes.
  * @param string $content Shortcode content.
  * @return string
  * @uses WebcomicTag::webcomic_collection_title()
  */
 public function webcomic_collection_title($atts, $content)
 {
     extract(shortcode_atts(array('prefix' => '', 'collection' => ''), $atts));
     $prefix = $content ? do_shortcode($content) : $prefix;
     return WebcomicTag::webcomic_collection_title($prefix, $collection);
 }