/** ENTRY META * Prints HTML with meta information for the categories, tags. * * @since Twenty Fifteen 1.0 */ function twentyfifteen_entry_meta() { if (is_sticky() && is_home() && !is_paged()) { printf('<span class="sticky-post">%s</span>', __('Featured', 'twentyfifteen')); } $format = get_post_format(); if (current_theme_supports('post-formats', $format)) { printf('<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', sprintf('<span class="screen-reader-text">%s </span>', _x('Format', 'Used before post format.', 'twentyfifteen')), esc_url(get_post_format_link($format)), get_post_format_string($format)); } $okArray = array('attachment', "post"); $webcomicsPostType = get_webcomic_collections(); foreach ($webcomicsPostType as $webcomic) { array_push($okArray, $webcomic); } if (in_array(get_post_type(), $okArray)) { $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; if (get_the_time('U') !== get_the_modified_time('U')) { $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; } $time_string = sprintf($time_string, esc_attr(get_the_date('c')), get_the_date(), esc_attr(get_the_modified_date('c')), get_the_modified_date()); printf('<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>', _x('Posted on', 'Used before publish date.', 'twentyfifteen'), esc_url(get_permalink()), $time_string); } if ('post' == get_post_type()) { if (is_singular() || is_multi_author()) { printf('<span class="byline"><span class="author vcard"><span class="screen-reader-text">%1$s </span><a class="url fn n" href="%2$s">%3$s</a></span></span>', _x('Author', 'Used before post author name.', 'twentyfifteen'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author()); } $categories_list = get_the_category_list(_x(', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen')); if ($categories_list && twentyfifteen_categorized_blog()) { printf('<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', _x('Categories', 'Used before category names.', 'twentyfifteen'), $categories_list); } $tags_list = get_the_tag_list('', _x(', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen')); if ($tags_list) { printf('<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', _x('Tags', 'Used before tag names.', 'twentyfifteen'), $tags_list); } } if (is_attachment() && wp_attachment_is_image()) { // Retrieve attachment metadata. $metadata = wp_get_attachment_metadata(); printf('<span class="full-size-link"><span class="screen-reader-text">%1$s </span><a href="%2$s">%3$s × %4$s</a></span>', _x('Full size', 'Used before full size attachment link.', 'twentyfifteen'), esc_url(wp_get_attachment_url()), $metadata['width'], $metadata['height']); } if (in_array(get_post_type(), $webcomicsPostType)) { if (is_singular() || is_multi_author()) { printf('<span class="byline"><span class="author vcard"><span class="screen-reader-text">%1$s </span><a class="url fn n" href="%2$s">%3$s</a></span></span>', _x('Author', 'Used before post author name.', 'twentyfifteen'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author()); } $collection_list = WebcomicTag::get_the_webcomic_collection_list(0, "", __(', ', 'twentytwelve')); $id = get_the_ID(); $storylineObj = wp_get_object_terms($id, get_post_type() . "_storyline"); $isChild = false; $parentStory; foreach ($storylineObj as $storyline) { if ($storyline->parent != 0) { $isChild = true; $parentStory = get_term_by("id", $storyline->parent, get_post_type() . "_storyline"); } } //var_dump($collection_list, $storylineObj, $isChild,$parentStory); if ($isChild) { $parentName = $parentStory->name; $storyline_list = WebcomicTag::get_the_webcomic_term_list(0, 'storyline', "<a href='" . get_term_link($parentStory) . "'>" . $parentName . "</a> > ", __(', ', 'twentytwelve')); } else { $storyline_list = WebcomicTag::get_the_webcomic_term_list(0, 'storyline', "", __(', ', 'twentytwelve')); } if ($collection_list && $storyline_list) { printf('<br><span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s > %3$s</span><br>', _x('Categories', 'Used before category names.', 'twentyfifteen'), $collection_list, $storyline_list); } $character_list = WebcomicTag::get_the_webcomic_term_list(0, 'character', '', __(', ', 'twentytwelve')); if ($character_list) { printf('<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span><br>', _x('Tags', 'Used before tag names.', 'twentyfifteen'), $character_list); } } if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) { echo '<span class="comments-link">'; comments_popup_link(__('Leave a comment', 'twentyfifteen'), __('1 Comment', 'twentyfifteen'), __('% Comments', 'twentyfifteen')); echo '</span>'; } }
<?php /** * Default age-restricted template. * * Strictly speaking this isn't an integration template. This * template loads whenever a reader reaches an age-restricted * webcomic they can't access and an appropriate template can't be * found in the current theme. * * @package Webcomic * @uses verify_webcomic_age() */ wp_die(is_null(verify_webcomic_age()) ? sprintf("\n <form method='post'>\n %s<br>\n <button type='submit' name='webcomic_birthday' value='1'>%s</button>\n <button type='submit' name='webcomic_birthday' value='0'>%s</button>\n </form>", sprintf(__('Are you %s years or older?', 'webcomic'), WebcomicTag::get_verify_webcomic_age()), __('Yes', 'webcomic'), __('No', 'webcomic')) : __("You don't have permission to view this content.", 'webcomic'), __('Restricted Content | Webcomic', 'webcomic'), 401);
?> <?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>
background-color: rgba(0, 0, 0, 0.2); } '; ?> <style> <?php echo $css; ?> </style> <?php $css = ""; } ?> <div class="nav-next"> <a href="<?php echo WebcomicTag::get_relative_webcomic_term_link("archive", "next", "character"); ?> " rel="next"> <span class="meta-nav" aria-hidden="true">Next Character</span> <span class="screen-reader-text">Next character archive:</span> <span class="post-title"><?php echo $characterObj[$next_char]->name; ?> </span> </a> </div> <?php } ?> </div>
<?php /** * Automagic integration for the_excerpt. * * @package Webcomic * @uses WebcomicTag::the_webcomic() */ $prepend = "<div class='integrated-webcomic'><div class='webcomic-img'>" . WebcomicTag::the_webcomic("medium", "self") . "</div><!-- .webcomic-img --></div><!-- .integrated-webcomic -->";
sprintf(__("%s Transcripts", "webcomic"), the_title("", "", false)); ?> </h3> <?php foreach ($transcripts as $post) { setup_postdata($post); ?> <div class="webcomic-transcript-content"><?php the_content(); ?> </div> <div class="webcomic-transcript-meta"> <?php printf(__('Transcribed by %1$s%2$s', "webcomic"), WebcomicTag::get_webcomic_transcript_authors(), WebcomicTag::get_the_webcomic_transcript_term_list(0, "webcomic_language", __(" in ", "webcomic"), __(", ", "webcomic"), __("", "webcomic"))); ?> </div> <?php wp_reset_postdata(); } } if (webcomic_transcripts_open()) { if (have_webcomic_transcripts(true) and $transcripts = get_webcomic_transcripts(true)) { foreach ($transcripts as $transcript) { webcomic_transcript_form(array(), $transcript); } } webcomic_transcript_form(); }
.post-navigation .nav-next a:before { background-color: rgba(0, 0, 0, 0.2); } '; ?> <style> <?php echo $css; ?> </style> <?php $css = ""; } ?> <div class="nav-next"> <a href="<?php echo WebcomicTag::get_relative_webcomic_term_link("archive", "next", "storyline"); ?> " rel="next"> <span class="meta-nav" aria-hidden="true">Next</span> <span class="screen-reader-text">Next storyline archive:</span> <span class="post-title"><?php echo $storylineObj[$next_story]->name; ?> </span> </a> </div> <?php } ?> </div>
/** * Start element output. * * @param string $output Walker output string. * @param object $term Current term being handled by the walker. * @param integer $depth Depth the walker is currently at. * @param array $args Arguments passed to the walker. * @uses WebcomicTag::get_webcomic_transcripts_link() * @filter string webcomic_transcript_term_list_title Filters the term titles used by `webcomic_list_transcript_languages`. */ public function start_el(&$output, $term, $depth = 0, $args = array(), $current = 0) { extract($args, $args['hierarchical'] ? EXTR_SKIP : EXTR_OVERWRITE); $term_title = apply_filters('webcomic_transcript_term_list_title', esc_attr($term->name), $term); $output .= '<li class="webcomic-transcript-term ' . $term->taxonomy . ' webcomic-transcript-term-' . $term->term_id . ($selected === $term->term_id ? ' current' : '') . '"><a href="' . WebcomicTag::get_webcomic_transcripts_link($term, $the_post) . '" class="webcomic-term-link">' . $term_title . '</a>'; }
/** * Return Webcomic attachments for a post. * * @param integer $id Post ID to retrieve attachments for. * @return array */ protected static function get_attachments($id = 0) { if (!current_user_can('edit_post', $id) and (!WebcomicTag::verify_webcomic_role(get_post_type($id)) or !WebcomicTag::verify_webcomic_age(get_post_type($id)))) { return array(); } return get_children(array('order' => 'ASC', 'orderby' => 'menu_order', 'post_type' => 'attachment', 'post_parent' => $id, 'post_mime_type' => 'image')); }
function webcomic2012_webcomic_meta() { // Translators: used between list items, there is a space after the comma. $categories_list = WebcomicTag::get_the_webcomic_term_list(0, 'storyline', '<span class="webcomic-storylines">', __(', ', 'twentytwelve'), '</span>'); // Translators: used between list items, there is a space after the comma. $tag_list = WebcomicTag::get_the_webcomic_term_list(0, 'character', '<span class="webcomic-characters">', __(', ', 'twentytwelve'), '</span>'); $date = sprintf('<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>', esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date())); $author = sprintf('<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>', esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('Veja todos os posts de %s', 'twentytwelve'), get_the_author())), get_the_author()); $collection_list = WebcomicTag::get_the_webcomic_collection_list(0, '<span class="webcomic-collections">', __(', ', 'twentytwelve'), '</span>'); // Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name. if ($tag_list) { $utility_text = __('Esta página possui roteiro e arte de %2$s para a história %1$s do %5$s. Publicada em %3$s<span class="by-author"> por %4$s</span>.', 'twentytwelve'); } elseif ($categories_list) { $utility_text = __('Esta página faz parte da história %1$s do %5$s. Publicada em %3$s<span class="by-author"> por %4$s</span>.', 'twentytwelve'); } else { $utility_text = __('Publicado em %3$s<span class="by-author"> por %4$s</span>.', 'twentytwelve'); } printf($utility_text, $categories_list, $tag_list, $date, $author, $collection_list); }
/** * Render widget settings. * * @param array $instance Specific instance settings. * @uses WebcomicTag::get_webcomic_collections() */ public function form($instance) { extract($instance); $collections = WebcomicTag::get_webcomic_collections(true); ?> <p> <label> <?php _e('Title', 'webcomic'); ?> <input type="text" id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " value="<?php echo empty($title) ? '' : esc_attr($title); ?> " class="widefat"> </label> </p> <p> <label> <?php _e('None Link', 'webcomic'); ?> <br> <span id="<?php echo $this->get_field_id('none_image'); ?> "><?php self::ajax_image(empty($none_image) ? 0 : $none_image, $this->get_field_name('none_image'), $this->get_field_id('none_image')); ?> </span><br> <input type="text" id="<?php echo $this->get_field_name('none'); ?> " name="<?php echo $this->get_field_name('none'); ?> " value="<?php echo empty($none) ? '' : esc_attr($none); ?> " class="widefat"> <span class="description"><?php _e('Displayed when transcription is on but no transcripts are available. The link text will be used as alternate text if you select an image.', 'webcomic'); ?> </span> </label> </p> <p> <label> <?php _e('Some Link', 'webcomic'); ?> <br> <span id="<?php echo $this->get_field_id('some_image'); ?> "><?php self::ajax_image(empty($some_image) ? 0 : $some_image, $this->get_field_name('some_image'), $this->get_field_id('some_image')); ?> </span><br> <input type="text" id="<?php echo $this->get_field_name('some'); ?> " name="<?php echo $this->get_field_name('some'); ?> " value="<?php echo empty($some) ? '' : esc_attr($some); ?> " class="widefat"> <span class="description"><?php _e('Displayed when one or more transcripts are available. The link text will be used as alternate text if you select an image.', 'webcomic'); ?> </span> </label> </p> <p> <label> <?php _e('Off Link', 'webcomic'); ?> <br> <span id="<?php echo $this->get_field_id('off_image'); ?> "><?php self::ajax_image(empty($off_image) ? 0 : $off_image, $this->get_field_name('off_image'), $this->get_field_id('off_image')); ?> </span><br> <input type="text" id="<?php echo $this->get_field_name('off'); ?> " name="<?php echo $this->get_field_name('off'); ?> " value="<?php echo empty($off) ? '' : esc_attr($off); ?> " class="widefat"> <span class="description"><?php _e('Displayed when transcription is turned off. The link text will be used as alternate text if you select an image.', 'webcomic'); ?> </span> </label> </p> <table class="widefat"> <thead> <tr> <th><?php _e('Token', 'webcomic'); ?> </th> <th><?php _e('Replacement', 'webcomic'); ?> </th> </tr> </thead> <tbody> <tr> <td>%title</td> <td><?php _e('Webcomic Title', 'webcomic'); ?> </td> </tr> <tr> <td>%date</td> <td><?php _e('Publish Date', 'webcomic'); ?> </td> </tr> <?php $count = 1; $sizes = '<tr><td>%full</td></tr>'; foreach (get_intermediate_image_sizes() as $size) { $count++; $sizes .= "<tr><td>%{$size}</td></tr>"; } echo preg_replace('/<\\/td><\\/tr>/', '</td><td rowspan="' . $count . '" style="border-left:thin solid #dfdfdf">' . __('Image Preview', 'webcomic') . '</td></tr>', $sizes, 1); ?> </tbody> </table> <?php }
/** * Handle webcomic_collection_cloud shortcode. * * @param array $atts Shortcode attributes. * @return string * @uses WebcomicTag::webcomic_collection_cloud() */ public function webcomic_collection_cloud($atts) { $r = shortcode_atts(array('id' => '', 'class' => '', 'smallest' => 75, 'largest' => 150, 'unit' => '%', 'image' => '', 'before' => '', 'after' => '', 'sep' => "\n", 'orderby' => '', 'order' => 'RAND', 'callback' => '', 'show_count' => false, 'target' => 'archive', 'selected' => 0), $atts); return WebcomicTag::webcomic_collection_cloud($r); }