/**
  * @see Walker::start_el()
  * @since 2.1.0
  *
  * @param string $output Passed by reference. Used to append additional content.
  * @param object $category Category data object.
  * @param int $depth Depth of category in reference to parents.
  * @param array $args
  */
 function start_el(&$output, $category, $depth = 0, $args = array(), $id = 0)
 {
     extract($args);
     $cat_name = esc_attr($category->name);
     $cat_name = apply_filters('list_cats', $cat_name, $category);
     $link = '<a href="' . esc_url(get_term_link($category)) . '" ';
     if ($use_desc_for_title == 0 || empty($category->description)) {
         $link .= 'title="' . esc_attr(sprintf(__('View all posts filed under %s'), $cat_name)) . '"';
     } else {
         $link .= 'title="' . esc_attr(strip_tags(apply_filters('category_description', $category->description, $category))) . '"';
     }
     $link .= '>';
     $link .= $cat_name . '</a>';
     if (!empty($feed_image) || !empty($feed)) {
         $link .= ' ';
         if (empty($feed_image)) {
             $link .= '( ';
         }
         $link .= '<a href="' . esc_url(get_term_feed_link($category->term_id, $category->taxonomy, $feed_type)) . '"';
         if (empty($feed)) {
             $alt = ' alt="' . sprintf(__('Feed for all posts filed under %s'), $cat_name) . '"';
         } else {
             $title = ' title="' . $feed . '"';
             $alt = ' alt="' . $feed . '"';
             $name = $feed;
             $link .= $title;
         }
         $link .= '>';
         if (empty($feed_image)) {
             $link .= $name;
         } else {
             $link .= "<img src='{$feed_image}'{$alt}{$title}" . ' />';
         }
         $link .= '</a>';
         if (empty($feed_image)) {
             $link .= ' )';
         }
     }
     if (!empty($show_count)) {
         $link .= ' (' . intval($category->count) . ' )';
     }
     if ('list' == $args['style']) {
         $output .= "\t<li";
         $class = 'cat-item cat-item-' . $category->term_id;
         if (!empty($current_category)) {
             $_current_category = get_term($current_category, $category->taxonomy);
             if ($category->term_id == $current_category) {
                 $class .= ' current-cat';
             } elseif ($category->term_id == $_current_category->parent) {
                 $class .= ' current-cat-parent';
             }
         }
         $output .= ' class="' . $class . '"';
         $output .= ' data-cat="' . $category->name . '"';
         $output .= ">{$link}\n";
     } else {
         $output .= "\t{$link}<br />\n";
     }
 }
/**
	*存档页信息
	*http://www.bgbk.org
*/
function Bing_archive_header()
{
    if (!is_archive()) {
        return;
    }
    if (is_author()) {
        $dashicons = 'admin-users';
        $name = $GLOBALS['authordata']->display_name;
        $description = get_the_author_meta('description');
        $feed_link = get_author_feed_link($GLOBALS['authordata']->ID);
    } elseif (is_date()) {
        $dashicons = 'calendar';
        if (is_day()) {
            $format = __('Y年m月d日', 'Bing');
        } elseif (is_month()) {
            $format = __('Y年m月', 'Bing');
        } else {
            $format = __('Y年', 'Bing');
        }
        $name = get_the_date($format);
        $description = sprintf(__('%s发布的文章', 'Bing'), $name);
    } else {
        $dashicons = is_tag() ? 'tag' : 'category';
        $name = single_term_title('', false);
        $description = term_description();
        $feed_link = get_term_feed_link(get_queried_object_id(), get_queried_object()->taxonomy);
    }
    $description = strip_tags($description);
    ?>
	<div class="span12 archive-header">
		<article class="panel">
			<header class="panel-header">
				<h3>
					<span class="dashicons dashicons-<?php 
    echo $dashicons;
    ?>
"></span><?php 
    echo $name;
    ?>
				</h3>
				<?php 
    if (Bing_mpanel('breadcrumbs')) {
        Bing_breadcrumbs('<span class="separator dashicons dashicons-arrow-right-alt2"></span>', '<span class="right breadcrumb"%s>', '</span>', '<span class="dashicons dashicons-admin-home"></span>' . __('首页', 'Bing'));
    }
    ?>
			</header>
			<?php 
    echo empty($description) ? __('无描述', 'Bing') : $description;
    if (!empty($feed_link)) {
        printf('<a href="%s" title="%s" class="feed-link"><span class="dashicons dashicons-rss"></span></a>', esc_url($feed_link), esc_attr(__('此存档的 Feed 源,可以使用 RSS 阅读器订阅这些内容', 'Bing')));
    }
    ?>
		</article>
	</div>
<?php 
}
Example #3
0
 function start_el($output, $term, $depth, $args)
 {
     extract($args);
     $term_name = esc_attr($term->name);
     $term_name = apply_filters('list_cats', $term_name, $term);
     $link = '<a href="' . get_term_link($term, $term->taxonomy) . '" ';
     if ($use_desc_for_title == 0 || empty($term->description)) {
         $link .= 'title="' . sprintf(__('View all posts tagged with %s'), $term_name) . '"';
     } else {
         $link .= 'title="' . esc_attr(strip_tags(apply_filters('category_description', $term->description, $term))) . '"';
     }
     $link .= '>';
     $link .= $term_name . '</a>';
     if (!empty($feed_image) || !empty($feed)) {
         $link .= ' ';
         if (empty($feed_image)) {
             $link .= '(';
         }
         $link .= '<a href="' . get_term_feed_link($term->term_id, $term->taxonomy, $feed_type) . '"';
         if (empty($feed)) {
             $alt = ' alt="' . sprintf(__('Feed for all posts tagged with %s'), $term_name) . '"';
         } else {
             $title = ' title="' . $feed . '"';
             $alt = ' alt="' . $feed . '"';
             $name = $feed;
             $link .= $title;
         }
         $link .= '>';
         if (empty($feed_image)) {
             $link .= $name;
         } else {
             $link .= "<img src='{$feed_image}'{$alt}{$title}" . ' />';
         }
         $link .= '</a>';
         if (empty($feed_image)) {
             $link .= ')';
         }
     }
     if (isset($show_count) && $show_count) {
         $link .= ' (' . intval($term->count) . ')';
     }
     if (isset($show_date) && $show_date) {
         $link .= ' ' . gmdate('Y-m-d', $term->last_update_timestamp);
     }
     if ('list' == $args['style']) {
         $output .= "\t<li";
         $class = 'tag-item tag-item-' . $term->term_id;
         if (is_tag($term->slug)) {
             $class .= ' current-tag';
         }
         $output .= ' class="' . $class . '"';
         $output .= ">{$link}\n";
     } else {
         $output .= "\t{$link}<br />\n";
     }
 }
function ap_tag_details()
{
    $var = get_query_var('question_tag');
    $tag = get_term_by('slug', $var, 'question_tag');
    echo '<div class="clearfix">';
    echo '<h3><a href="' . get_tag_link($tag) . '">' . $tag->name . '</a></h3>';
    echo '<div class="ap-taxo-meta">';
    echo '<span class="count">' . $tag->count . ' ' . __('Questions', 'tags-for-anspress') . '</span>';
    echo '<a class="aicon-rss feed-link" href="' . get_term_feed_link($tag->term_id, 'question_tag') . '" title="Subscribe to ' . $tag->name . '" rel="nofollow"></a>';
    echo '</div>';
    echo '</div>';
    echo '<p class="desc clearfix">' . $tag->description . '</p>';
}
function ap_category_details()
{
    $var = get_query_var('question_category');
    $category = get_term_by('slug', $var, 'question_category');
    echo '<div class="clearfix">';
    echo '<h3><a href="' . get_category_link($category) . '">' . $category->name . '</a></h3>';
    echo '<div class="ap-taxo-meta">';
    echo '<span class="count">' . $category->count . ' ' . __('Questions', 'categories-for-anspress') . '</span>';
    echo '<a class="aicon-rss feed-link" href="' . get_term_feed_link($category->term_id, 'question_category') . '" title="Subscribe to ' . $category->name . '" rel="nofollow"></a>';
    echo '</div>';
    echo '</div>';
    echo '<p class="desc clearfix">' . $category->description . '</p>';
    $child = get_terms(array('taxonomy' => 'question_category'), array('parent' => $category->term_id, 'hierarchical' => false, 'hide_empty' => false));
    if ($child) {
        echo '<ul class="ap-child-list clearfix">';
        foreach ($child as $key => $c) {
            echo '<li><a class="taxo-title" href="' . get_category_link($c) . '">' . $c->name . '<span>' . $c->count . '</span></a>';
            echo '</li>';
        }
        echo '</ul>';
    }
}
function powerpressadmin_edit_itunes_feed($FeedSettings, $General, $FeedAttribs = array())
{
    $feed_slug = $FeedAttribs['feed_slug'];
    $cat_ID = $FeedAttribs['category_id'];
    $SupportUploads = powerpressadmin_support_uploads();
    if (!isset($FeedSettings['itunes_subtitle'])) {
        $FeedSettings['itunes_subtitle'] = '';
    }
    if (!isset($FeedSettings['itunes_summary'])) {
        $FeedSettings['itunes_summary'] = '';
    }
    if (!isset($FeedSettings['itunes_keywords'])) {
        $FeedSettings['itunes_keywords'] = '';
    }
    if (!isset($FeedSettings['itunes_cat_1'])) {
        $FeedSettings['itunes_cat_1'] = '';
    }
    if (!isset($FeedSettings['itunes_cat_2'])) {
        $FeedSettings['itunes_cat_2'] = '';
    }
    if (!isset($FeedSettings['itunes_cat_3'])) {
        $FeedSettings['itunes_cat_3'] = '';
    }
    if (!isset($FeedSettings['itunes_explicit'])) {
        $FeedSettings['itunes_explicit'] = 0;
    }
    if (!isset($FeedSettings['itunes_talent_name'])) {
        $FeedSettings['itunes_talent_name'] = '';
    }
    if (!isset($FeedSettings['email'])) {
        $FeedSettings['email'] = '';
    }
    if (!isset($FeedSettings['itunes_new_feed_url_podcast'])) {
        $FeedSettings['itunes_new_feed_url_podcast'] = '';
    }
    if (!isset($FeedSettings['itunes_new_feed_url'])) {
        $FeedSettings['itunes_new_feed_url'] = '';
    }
    $AdvancediTunesSettings = !empty($FeedSettings['itunes_summary']);
    if (!empty($FeedSettings['itunes_subtitle'])) {
        $AdvancediTunesSettings = true;
    }
    ?>

<h3><?php 
    echo __('iTunes Settings', 'powerpress');
    ?>
</h3>
<table class="form-table">
<tr valign="top">
<th scope="row">
<?php 
    echo __('iTunes Program Subtitle', 'powerpress');
    ?>
 <br />
</th>
<td>
<input type="text" name="Feed[itunes_subtitle]" style="width: 60%;"  value="<?php 
    echo esc_attr($FeedSettings['itunes_subtitle']);
    ?>
" maxlength="250" />
</td>
</tr>

<tr valign="top">
<th scope="row">

<?php 
    echo __('iTunes Program Summary', 'powerpress');
    ?>
</th>
<td>
<p style="margin-top: 5px;"><?php 
    echo __('Your summary may not contain HTML and cannot exceed 4,000 characters in length.', 'powerpress');
    ?>
</p>

<textarea name="Feed[itunes_summary]" rows="5" style="width:80%;" ><?php 
    echo $FeedSettings['itunes_summary'];
    ?>
</textarea>
</td>
</tr>

<?php 
    if (!empty($General['advanced_mode_2'])) {
        ?>
<tr valign="top">
<th scope="row">

<?php 
        echo __('iTunes Episode Summary', 'powerpress');
        ?>
</th>
<td>
<div><input type="checkbox" name="Feed[enhance_itunes_summary]" value="1" <?php 
        echo !empty($FeedSettings['enhance_itunes_summary']) ? 'checked ' : '';
        ?>
/> <?php 
        echo __('Optimize iTunes Summary from Blog Posts', 'powerpress');
        ?>
</div>
<p>
	<?php 
        echo __('Creates a friendlier view of your post/episode content by converting web links and images to clickable links in the iTunes application.', 'powerpress');
        ?>
</p>
</td>
</tr>
</table>


<table class="form-table">
<?php 
        if (!empty($FeedSettings['itunes_keywords'])) {
            ?>
<tr valign="top">
<th scope="row">
<?php 
            echo __('iTunes Program Keywords', 'powerpress');
            ?>
 <br />
</th>
<td>
<input type="text" name="Feed[itunes_keywords]" style="width: 60%;"  value="<?php 
            echo esc_attr($FeedSettings['itunes_keywords']);
            ?>
" maxlength="250" />
<p><?php 
            echo __('Feature Deprecated by Apple. Keywords above are for your reference only.', 'powerpress');
            ?>
</p>
</td>
</tr>
<?php 
        }
        // End iTunes keywords
    }
    // end advanced mode
    ?>

<tr valign="top">
<th scope="row">
<?php 
    echo __('iTunes Category', 'powerpress');
    ?>
 
<span class="powerpress-required"><?php 
    echo __('Required', 'powerpress');
    ?>
</span>
</th>
<td>
<select name="Feed[itunes_cat_1]" class="bpp_input_med">
<?php 
    $MoreCategories = false;
    if (!empty($FeedSettings['itunes_cat_2'])) {
        $MoreCategories = true;
    } else {
        if (!empty($FeedSettings['itunes_cat_3'])) {
            $MoreCategories = true;
        }
    }
    $Categories = powerpress_itunes_categories(true);
    echo '<option value="">' . __('Select Category', 'powerpress') . '</option>';
    $UseCategories = powerpress_categories_strict($Categories, $FeedSettings['itunes_cat_1']);
    while (list($value, $desc) = each($UseCategories)) {
        echo "\t<option value=\"{$value}\"" . ($FeedSettings['itunes_cat_1'] == $value ? ' selected' : '') . ">" . htmlspecialchars($desc) . "</option>\n";
    }
    reset($Categories);
    ?>
</select>
<?php 
    if (!$MoreCategories && empty($General['seo_itunes'])) {
        ?>
	<a href="#" onclick="document.getElementById('more_itunes_cats').style.display='block';return false;"><?php 
        echo __('more', 'powerpress');
        ?>
</a>
<?php 
    }
    ?>
	<p>
		<?php 
    echo __('The category above is where you will appear when browsing iTunes.', 'powerpress');
    ?>
	</p>
</td>
</tr>
</table>


<!-- start advanced features -->
<div id="more_itunes_cats" style="display: <?php 
    echo $MoreCategories || !empty($General['seo_itunes']) ? 'block' : 'none';
    ?>
;">
<table class="form-table">
<tr valign="top">
<th scope="row">
<?php 
    echo __('iTunes Category 2', 'powerpress');
    ?>
 
</th>
<td>
<select name="Feed[itunes_cat_2]" class="bpp_input_med">
<?php 
    echo '<option value="">' . __('Select Category', 'powerpress') . '</option>';
    $UseCategories = powerpress_categories_strict($Categories, $FeedSettings['itunes_cat_2']);
    while (list($value, $desc) = each($UseCategories)) {
        echo "\t<option value=\"{$value}\"" . ($FeedSettings['itunes_cat_2'] == $value ? ' selected' : '') . ">" . htmlspecialchars($desc) . "</option>\n";
    }
    reset($Categories);
    ?>
</select>
<?php 
    if (!empty($General['seo_itunes'])) {
        ?>
			<p>
				<em><?php 
        echo __('SEO Suggestion: Select a second category.', 'powerpress');
        ?>
</em>
			</p>
<?php 
    }
    ?>

</td>
</tr>

<tr valign="top">
<th scope="row">
<?php 
    echo __('iTunes Category 3', 'powerpress');
    ?>
 
</th>
<td>
<select name="Feed[itunes_cat_3]" class="bpp_input_med">
<?php 
    echo '<option value="">' . __('Select Category', 'powerpress') . '</option>';
    $UseCategories = powerpress_categories_strict($Categories, $FeedSettings['itunes_cat_3']);
    while (list($value, $desc) = each($UseCategories)) {
        echo "\t<option value=\"{$value}\"" . ($FeedSettings['itunes_cat_3'] == $value ? ' selected' : '') . ">" . htmlspecialchars($desc) . "</option>\n";
    }
    reset($Categories);
    ?>
</select>
<?php 
    if (!empty($General['seo_itunes'])) {
        ?>
			<p>
				<em><?php 
        echo __('SEO Suggestion: Select a third category.', 'powerpress');
        ?>
</em>
			</p>
<?php 
    }
    ?>
</td>
</tr>
</table>
</div>
<!-- end advanced features -->


<table class="form-table">
<tr valign="top">
<th scope="row">
<?php 
    echo __('iTunes Explicit', 'powerpress');
    ?>
 
</th>
<td>
<select name="Feed[itunes_explicit]" class="bpp_input_med">
<?php 
    $explicit = array(0 => __('No - display nothing', 'powerpress'), 1 => __('Yes - explicit content', 'powerpress'), 2 => __('Clean - no explicit content', 'powerpress'));
    while (list($value, $desc) = each($explicit)) {
        echo "\t<option value=\"{$value}\"" . ($FeedSettings['itunes_explicit'] == $value ? ' selected' : '') . ">{$desc}</option>\n";
    }
    ?>
</select>
</td>
</tr>
<?php 
    if (!empty($General['advanced_mode_2'])) {
        ?>
<!-- start advanced features -->
<tr valign="top">
<th scope="row">
<?php 
        echo __('iTunes Author Name', 'powerpress');
        ?>
 
</th>
<td>
<input type="text" name="Feed[itunes_talent_name]" class="bpp_input_med" value="<?php 
        echo esc_attr($FeedSettings['itunes_talent_name']);
        ?>
" maxlength="250" /><br />
<div><input type="checkbox" name="Feed[itunes_author_post]" value="1" <?php 
        echo !empty($FeedSettings['itunes_author_post']) ? 'checked ' : '';
        ?>
/> <?php 
        echo __('Use blog post author\'s name for individual episodes.', 'powerpress');
        ?>
</div>

<?php 
        if (!empty($General['seo_itunes'])) {
            ?>
			<p>
				<em><?php 
            echo __('SEO Suggestion: Include talent names and slogans not mentioned in the show title.', 'powerpress');
            ?>
</em>
			</p>
<?php 
        }
        ?>
</td>
</tr>
<!-- end advanced features -->
<?php 
    }
    ?>

<tr valign="top">
<th scope="row">
<?php 
    echo __('iTunes Email', 'powerpress');
    ?>
 
<span class="powerpress-required"><?php 
    echo __('Required', 'powerpress');
    ?>
</span>
</th>
<td>
<input type="text" name="Feed[email]" class="bpp_input_med" value="<?php 
    echo esc_attr($FeedSettings['email']);
    ?>
" maxlength="250" />
<div>(<?php 
    echo __('iTunes will email this address when your podcast is accepted into the iTunes Directory.', 'powerpress');
    ?>
)</div>
</td>
</tr>
</table>

<?php 
    if (!empty($General['advanced_mode_2'])) {
        ?>
<!-- start advanced features -->
<table class="form-table">
	<tr valign="top">
	<th scope="row" >

<?php 
        echo __('iTunes New Feed URL', 'powerpress');
        ?>
</th> 
	<td>
		<div id="new_feed_url_step_1" style="display: <?php 
        echo !empty($FeedSettings['itunes_new_feed_url']) || !empty($FeedSettings['itunes_new_feed_url_podcast']) ? 'none' : 'block';
        ?>
;">
			 <p style="margin-top: 5px;"><strong><a href="#" onclick="return powerpress_new_feed_url_prompt();"><?php 
        echo __('Set iTunes New Feed URL', 'powerpress');
        ?>
</a></strong></p>
			 <p><strong>
			 <?php 
        echo __('The iTunes New Feed URL option works primarily for Apple\'s iTunes application only, and should only be used if you are unable to implement a HTTP 301 redirect.', 'powerpress');
        ?>
			 <?php 
        echo __('A 301 redirect will route <u>all podcast clients including iTunes</u> to your new feed address.', 'powerpress');
        ?>
			 </strong> 
			 </p>
			 <p>
			 <?php 
        echo __('Learn more:', 'powerpress');
        ?>
 <a href="http://create.blubrry.com/manual/syndicating-your-podcast-rss-feeds/changing-your-podcast-rss-feed-address-url/" target="_blank"><?php 
        echo __('Changing Your Podcast RSS Feed Address (URL)', 'powerpress');
        ?>
</a>
			</p>
		</div>
		<div id="new_feed_url_step_2" style="display: <?php 
        echo !empty($FeedSettings['itunes_new_feed_url']) || !empty($FeedSettings['itunes_new_feed_url_podcast']) ? 'block' : 'none';
        ?>
;">
			<p style="margin-top: 5px;"><strong><?php 
        echo __('WARNING: Changes made here are permanent. If the New Feed URL entered is incorrect, you will lose subscribers and will no longer be able to update your listing in the iTunes Store.', 'powerpress');
        ?>
</strong></p>
			<p><strong><?php 
        echo __('DO NOT MODIFY THIS SETTING UNLESS YOU ABSOLUTELY KNOW WHAT YOU ARE DOING.', 'powerpress');
        ?>
</strong></p>
			<p>
				<?php 
        echo htmlspecialchars(sprintf(__('Apple recommends you maintain the %s tag in your feed for at least two weeks to ensure that most subscribers will receive the new New Feed URL.', 'powerpress'), '<itunes:new-feed-url>'));
        ?>
			</p>
			<p>
			<?php 
        $FeedName = __('Main RSS2 feed', 'powerpress');
        $FeedURL = get_feed_link('rss2');
        if ($cat_ID) {
            $category = get_category_to_edit($cat_ID);
            $FeedName = sprintf(__('%s category feed', 'powerpress'), htmlspecialchars($category->name));
            $FeedURL = get_category_feed_link($cat_ID);
        } else {
            if ($feed_slug) {
                if (!empty($General['custom_feeds'][$feed_slug])) {
                    $FeedName = $General['custom_feeds'][$feed_slug];
                } else {
                    $FeedName = __('Podcast', 'powerpress');
                }
                $FeedName = trim($FeedName) . ' ' . __('feed', 'powerpress');
                $FeedURL = get_feed_link($feed_slug);
            } else {
                if ($FeedAttribs['type'] == 'ttid') {
                    $term_object = get_term_to_edit($FeedAttribs['term_id'], $FeedAttribs['taxonomy_type']);
                    $FeedName = sprintf(__('%s taxonomy term feed', 'powerpress'), htmlspecialchars($term_object->name));
                    $FeedURL = get_term_feed_link($FeedAttribs['term_id'], $FeedAttribs['taxonomy_type'], 'rss2');
                }
            }
        }
        echo sprintf(__('The New Feed URL value below will be applied to the %s (%s).', 'powerpress'), $FeedName, $FeedURL);
        ?>
			</p>
			<p style="margin-bottom: 0;">
				<label style="width: 25%; float:left; display:block; font-weight: bold;"><?php 
        echo __('New Feed URL', 'powerpress');
        ?>
</label>
				<input type="text" name="Feed[itunes_new_feed_url]" style="width: 55%;"  value="<?php 
        echo esc_attr($FeedSettings['itunes_new_feed_url']);
        ?>
" maxlength="250" />
			</p>
			<p style="margin-left: 25%;margin-top: 0;font-size: 90%;">(<?php 
        echo __('Leave blank for no New Feed URL', 'powerpress');
        ?>
)</p>
			
			<p><a href="http://www.apple.com/itunes/whatson/podcasts/specs.html#changing" target="_blank"><?php 
        echo __('More information regarding the iTunes New Feed URL is available here.', 'powerpress');
        ?>
</a></p>
			<p>
<?php 
        if (!$cat_ID && !$feed_slug) {
            if (empty($General['channels'])) {
                echo sprintf(__('Please activate the \'Custom Podcast Channels\' Advanced Option to set the new-feed-url for your podcast only feed (%s)', 'powerpress'), get_feed_link('podcast'));
            } else {
                echo sprintf(__('Please navigate to the \'Custom Podcast Channels\' section to set the new-feed-url for your podcast only feed (%s)', 'powerpress'), get_feed_link('podcast'));
            }
        }
        ?>
			</p>
		</div>
	</td>
	</tr>
</table>
<?php 
        if (defined('POWERPRESS_NOT_SUPPORTED')) {
            // start powerpress not supported features
            ?>
<fieldset style="border: 1px dashed #333333;">
<legend style="margin: 0 20px; padding: 0 5px; font-weight: bold;"><?php 
            echo __('Features Not Supported by PowerPress', 'powerpress');
            ?>
</legend>

	<div style="margin-left: 230px; margin-bottom: 10px;">
		<p>
			<strong style="color: #CC0000; font-weight: bold;"><?php 
            echo __('USE THE FOLLOWING SETTINGS AT YOUR OWN RISK.', 'powerpress');
            ?>
</strong>
		</p>
		<p style="margin-bottom: 0;">
			<?php 
            echo __('Feeds affected', 'powerpress');
            ?>
: 
		</p>
		<div style="margin-left: 20px;">
			<?php 
            // $General, $feed_slug=false, $cat_ID=false
            if ($feed_slug) {
                echo '<a href="';
                echo get_feed_link($feed_slug);
                echo '" target="_blank">';
                echo get_feed_link($feed_slug);
                echo '</a>';
            } else {
                if ($cat_ID) {
                    echo '<a href="';
                    echo get_category_feed_link($cat_ID);
                    echo '" target="_blank">';
                    echo get_category_feed_link($cat_ID);
                    echo '</a>';
                } else {
                    echo '<a href="';
                    echo get_feed_link('feed');
                    echo '" target="_blank">';
                    echo get_feed_link('feed');
                    echo '</a>';
                    if (empty($General['custom_feeds']['podcast'])) {
                        echo '<br /><a href="';
                        echo get_feed_link('podcast');
                        echo '" target="_blank">';
                        echo get_feed_link('podcast');
                        echo '</a>';
                    }
                }
            }
            ?>
		</div>
		
	</div>
<div id="permanent_itunes_settings">
<table class="form-table">
	
	<tr valign="top">
	<th scope="row" >

<?php 
            echo __('iTunes Block', 'powerpress');
            ?>
</th> 
	<td>
		<input type="checkbox" name="Feed[itunes_block]" value="1" <?php 
            if (!empty($FeedSettings['itunes_block'])) {
                echo 'checked';
            }
            ?>
 />
		<?php 
            echo __('Prevent the entire podcast from appearing in the iTunes Podcast directory.', 'powerpress');
            ?>
	</td>
	</tr>
	
	<tr valign="top">
	<th scope="row" >

<?php 
            echo __('iTunes Complete', 'powerpress');
            ?>
</th> 
	<td>
		<input type="checkbox" name="Feed[itunes_complete]" value="1" <?php 
            if (!empty($FeedSettings['itunes_complete'])) {
                echo 'checked';
            }
            ?>
 />
		<?php 
            echo __('Indicate the completion of a podcast. iTunes will no longer update your listing in the iTunes Podcast directory.', 'powerpress');
            ?>
	</td>
	</tr>
</table>
</div>
</fieldset>
<?php 
        }
        // End PowerPress not supported features
        ?>
<!-- end advanced features -->
<?php 
    }
    // end other advanced options
}
/**
 * Display the links to the extra feeds such as category feeds.
 *
 * @since 2.8.0
 *
 * @param array $args Optional arguments.
 */
function feed_links_extra($args = array())
{
    $defaults = array('separator' => _x('&raquo;', 'feed link'), 'singletitle' => __('%1$s %2$s %3$s Comments Feed'), 'cattitle' => __('%1$s %2$s %3$s Category Feed'), 'tagtitle' => __('%1$s %2$s %3$s Tag Feed'), 'taxtitle' => __('%1$s %2$s %3$s %4$s Feed'), 'authortitle' => __('%1$s %2$s Posts by %3$s Feed'), 'searchtitle' => __('%1$s %2$s Search Results for &#8220;%3$s&#8221; Feed'), 'posttypetitle' => __('%1$s %2$s %3$s Feed'));
    $args = wp_parse_args($args, $defaults);
    if (is_singular()) {
        $id = 0;
        $post = get_post($id);
        if (comments_open() || pings_open() || $post->comment_count > 0) {
            $title = sprintf($args['singletitle'], get_bloginfo('name'), $args['separator'], the_title_attribute(array('echo' => false)));
            $href = get_post_comments_feed_link($post->ID);
        }
    } elseif (is_post_type_archive()) {
        $post_type = get_query_var('post_type');
        if (is_array($post_type)) {
            $post_type = reset($post_type);
        }
        $post_type_obj = get_post_type_object($post_type);
        $title = sprintf($args['posttypetitle'], get_bloginfo('name'), $args['separator'], $post_type_obj->labels->name);
        $href = get_post_type_archive_feed_link($post_type_obj->name);
    } elseif (is_category()) {
        $term = get_queried_object();
        if ($term) {
            $title = sprintf($args['cattitle'], get_bloginfo('name'), $args['separator'], $term->name);
            $href = get_category_feed_link($term->term_id);
        }
    } elseif (is_tag()) {
        $term = get_queried_object();
        if ($term) {
            $title = sprintf($args['tagtitle'], get_bloginfo('name'), $args['separator'], $term->name);
            $href = get_tag_feed_link($term->term_id);
        }
    } elseif (is_tax()) {
        $term = get_queried_object();
        $tax = get_taxonomy($term->taxonomy);
        $title = sprintf($args['taxtitle'], get_bloginfo('name'), $args['separator'], $term->name, $tax->labels->singular_name);
        $href = get_term_feed_link($term->term_id, $term->taxonomy);
    } elseif (is_author()) {
        $author_id = intval(get_query_var('author'));
        $title = sprintf($args['authortitle'], get_bloginfo('name'), $args['separator'], get_the_author_meta('display_name', $author_id));
        $href = get_author_feed_link($author_id);
    } elseif (is_search()) {
        $title = sprintf($args['searchtitle'], get_bloginfo('name'), $args['separator'], get_search_query(false));
        $href = get_search_feed_link();
    } elseif (is_post_type_archive()) {
        $title = sprintf($args['posttypetitle'], get_bloginfo('name'), $args['separator'], post_type_archive_title('', false));
        $post_type_obj = get_queried_object();
        if ($post_type_obj) {
            $href = get_post_type_archive_feed_link($post_type_obj->name);
        }
    }
    if (isset($title) && isset($href)) {
        echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr($title) . '" href="' . esc_url($href) . '" />' . "\n";
    }
}
Example #8
0
 /**
  * Removes unneeded query variables from the URL.
  * @return boolean
  */
 public function clean_permalink()
 {
     if (is_robots() || get_query_var('sitemap')) {
         return false;
     }
     global $wp_query;
     // Recreate current URL
     $cururl = 'http';
     if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
         $cururl .= 's';
     }
     $cururl .= '://';
     if ($_SERVER['SERVER_PORT'] != '80' && $_SERVER['SERVER_PORT'] != '443') {
         $cururl .= $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];
     } else {
         $cururl .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
     }
     $properurl = '';
     if (is_singular()) {
         global $post;
         if (empty($post)) {
             $post = $wp_query->get_queried_object();
         }
         $properurl = get_permalink($post->ID);
         $page = get_query_var('page');
         if ($page && $page != 1) {
             $post = get_post($post->ID);
             $page_count = substr_count($post->post_content, '<!--nextpage-->');
             if ($page > $page_count + 1) {
                 $properurl = user_trailingslashit(trailingslashit($properurl) . ($page_count + 1));
             } else {
                 $properurl = user_trailingslashit(trailingslashit($properurl) . $page);
             }
         }
         // Fix reply to comment links, whoever decided this should be a GET variable?
         $result = preg_match('`(\\?replytocom=[^&]+)`', $_SERVER['REQUEST_URI'], $matches);
         if ($result) {
             $properurl .= str_replace('?replytocom=', '#comment-', $matches[0]);
         }
         // Prevent cleaning out posts & page previews for people capable of viewing them
         if (isset($_GET['preview']) && isset($_GET['preview_nonce']) && current_user_can('edit_post')) {
             $properurl = '';
         }
     } elseif (is_front_page()) {
         if ($this->is_home_posts_page()) {
             $properurl = get_bloginfo('url') . '/';
         } elseif ($this->is_home_static_page()) {
             global $post;
             $properurl = get_permalink($post->ID);
         }
     } elseif (is_category() || is_tag() || is_tax()) {
         $term = $wp_query->get_queried_object();
         if (is_feed()) {
             $properurl = get_term_feed_link($term->term_id, $term->taxonomy);
         } else {
             $properurl = get_term_link($term, $term->taxonomy);
         }
     } elseif (is_search()) {
         $s = preg_replace('`(%20|\\+)`', ' ', get_search_query());
         $properurl = get_bloginfo('url') . '/?s=' . rawurlencode($s);
     } elseif (is_404()) {
         if (function_exists('is_multisite') && is_multisite() && !is_subdomain_install() && is_main_site()) {
             if ($cururl == get_bloginfo('url') . '/blog/' || $cururl == get_bloginfo('url') . '/blog') {
                 if ($this->is_home_static_page()) {
                     $properurl = get_permalink(get_option('page_for_posts'));
                 } else {
                     $properurl = get_bloginfo('url') . '/';
                 }
             }
         }
     }
     if (!empty($properurl) && $wp_query->query_vars['paged'] != 0 && $wp_query->post_count != 0) {
         if (is_search()) {
             $properurl = get_bloginfo('url') . '/page/' . $wp_query->query_vars['paged'] . '/?s=' . rawurlencode(get_search_query());
         } else {
             $properurl = user_trailingslashit(trailingslashit($properurl) . 'page/' . $wp_query->query_vars['paged']);
         }
     }
     // Prevent cleaning out the WP Subscription managers interface for everyone
     if (isset($_GET['wp-subscription-manager'])) {
         $properurl = '';
     }
     /**
      * Filter: 'wpseo_whitelist_permalink_vars' - Allow plugins to register their own variables not to clean
      *
      * @api array $unsigned Array of permalink variables _not_ to clean. Empty by default.
      */
     $whitelisted_extravars = apply_filters('wpseo_whitelist_permalink_vars', array());
     if ($this->options['cleanpermalink-googlesitesearch'] === true) {
         // Prevent cleaning out Google Site searches
         $whitelisted_extravars = array_merge($whitelisted_extravars, array('q', 'cx', 'debug', 'cof', 'ie', 'sa'));
     }
     if ($this->options['cleanpermalink-googlecampaign'] === true) {
         // Prevent cleaning out Google Analytics campaign variables
         $whitelisted_extravars = array_merge($whitelisted_extravars, array('utm_campaign', 'utm_medium', 'utm_source', 'utm_content', 'utm_term', 'utm_id', 'gclid'));
     }
     if ($this->options['cleanpermalink-extravars'] !== '') {
         $extravars = explode(',', $this->options['cleanpermalink-extravars']);
         $extravars = array_map('trim', $extravars);
         $whitelisted_extravars = array_merge($whitelisted_extravars, $extravars);
         unset($extravars);
     }
     foreach ($whitelisted_extravars as $get) {
         if (isset($_GET[trim($get)])) {
             $properurl = '';
         }
     }
     if (!empty($properurl) && $cururl != $properurl) {
         wp_safe_redirect($properurl, 301);
         exit;
     }
 }
 /**
  * Start the element output.
  *
  * @see Walker::start_el()
  *
  * @since 2.1.0
  *
  * @param string $output   Passed by reference. Used to append additional content.
  * @param object $category Category data object.
  * @param int    $depth    Depth of category in reference to parents. Default 0.
  * @param array  $args     An array of arguments. @see wp_list_categories()
  * @param int    $id       ID of the current category.
  */
 public function start_el(&$output, $category, $depth = 0, $args = array(), $id = 0)
 {
     /** This filter is documented in wp-includes/category-template.php */
     $cat_name = apply_filters('list_cats', esc_attr($category->name), $category);
     // Don't generate an element if the category name is empty.
     if (!$cat_name) {
         return;
     }
     $link = '<a href="' . esc_url(get_term_link($category)) . '" ';
     if ($args['use_desc_for_title'] && !empty($category->description)) {
         /**
          * Filter the category description for display.
          *
          * @since 1.2.0
          *
          * @param string $description Category description.
          * @param object $category    Category object.
          */
         $link .= 'title="' . esc_attr(strip_tags(apply_filters('category_description', $category->description, $category))) . '"';
     }
     $link .= '>';
     $link .= $cat_name . '</a>';
     if (!empty($args['feed_image']) || !empty($args['feed'])) {
         $link .= ' ';
         if (empty($args['feed_image'])) {
             $link .= '(';
         }
         $link .= '<a href="' . esc_url(get_term_feed_link($category->term_id, $category->taxonomy, $args['feed_type'])) . '"';
         if (empty($args['feed'])) {
             $alt = ' alt="' . sprintf(__('Feed for all posts filed under %s'), $cat_name) . '"';
         } else {
             $alt = ' alt="' . $args['feed'] . '"';
             $name = $args['feed'];
             $link .= empty($args['title']) ? '' : $args['title'];
         }
         $link .= '>';
         if (empty($args['feed_image'])) {
             $link .= $name;
         } else {
             $link .= "<img src='" . $args['feed_image'] . "'{$alt}" . ' />';
         }
         $link .= '</a>';
         if (empty($args['feed_image'])) {
             $link .= ')';
         }
     }
     if (!empty($args['show_count'])) {
         $link .= ' (' . number_format_i18n($category->count) . ')';
     }
     if ('list' == $args['style']) {
         $output .= "\t<li";
         $css_classes = array('cat-item', 'cat-item-' . $category->term_id);
         if (!empty($args['current_category'])) {
             // 'current_category' can be an array, so we use `get_terms()`.
             $_current_terms = get_terms($category->taxonomy, array('include' => $args['current_category'], 'hide_empty' => false));
             foreach ($_current_terms as $_current_term) {
                 if ($category->term_id == $_current_term->term_id) {
                     $css_classes[] = 'current-cat';
                 } elseif ($category->term_id == $_current_term->parent) {
                     $css_classes[] = 'current-cat-parent';
                 }
             }
         }
         /**
          * Filter the list of CSS classes to include with each category in the list.
          *
          * @since 4.2.0
          *
          * @see wp_list_categories()
          *
          * @param array  $css_classes An array of CSS classes to be applied to each list item.
          * @param object $category    Category data object.
          * @param int    $depth       Depth of page, used for padding.
          * @param array  $args        An array of wp_list_categories() arguments.
          */
         $css_classes = implode(' ', apply_filters('category_css_class', $css_classes, $category, $depth, $args));
         $output .= ' class="' . $css_classes . '"';
         $output .= ">{$link}\n";
     } elseif (isset($args['separator'])) {
         $output .= "\t{$link}" . $args['separator'] . "\n";
     } else {
         $output .= "\t{$link}<br />\n";
     }
 }
 /**
  * Start the element output.
  *
  * @see Walker::start_el()
  *
  * @since 1.1.0
  *
  * @uses iconize_get_term_icon_by()
  * @uses iconize_get_icon()
  *
  * @param string $output   Passed by reference. Used to append additional content.
  * @param object $category Category data object.
  * @param int    $depth    Depth of category in reference to parents. Default 0.
  * @param array  $args     An array of arguments. @see wp_list_categories()
  * @param int    $id       ID of the current category.
  */
 function start_el(&$output, $category, $depth = 0, $args = array(), $id = 0)
 {
     extract($args);
     // Retrive an array of settings for term icon configured in term edit screen if there is icon.
     $icon = iconize_get_term_icon_by('id', $category->term_id, $category->taxonomy);
     $term_icon_args = array();
     if (!empty($icon)) {
         $term_icon_args = iconize_get_term_icon_by('id', $category->term_id, $category->taxonomy, 'array');
     }
     // Validate custom settings passed with 'iconize' arg to wp_list_categories().
     $hover_effect = isset($iconized['hover_effect']) ? (string) $iconized['hover_effect'] : 'default';
     $color = isset($iconized['color']) ? (string) $iconized['color'] : 'default';
     $hover_effect_trigger = isset($iconized['hover_effect_trigger']) ? (string) $iconized['hover_effect_trigger'] : 'link';
     $hover_color_change = isset($iconized['hover_color_change']) ? (bool) $iconized['hover_color_change'] : false;
     $fallback_icon_args = isset($iconized['fallback_icon']) ? (array) $iconized['fallback_icon'] : array();
     $override_icons = isset($iconized['override_icons']) ? (bool) $iconized['override_icons'] : false;
     $style = isset($iconized['style']) ? (string) $iconized['style'] : 'default';
     $after_icon = isset($iconized['after_icon']) ? (string) $iconized['after_icon'] : '&nbsp;&nbsp;';
     // Determine which icon to display.
     if (true === $override_icons) {
         $icon_args = $fallback_icon_args;
     } else {
         $icon_args = $term_icon_args;
         if (empty($icon_args) && !empty($fallback_icon_args)) {
             $icon_args = $fallback_icon_args;
         }
     }
     // Modify icon args if needed.
     if (!empty($icon_args)) {
         if ('iconize' === $style) {
             $icon_args['icon_custom_classes'] .= !empty($icon_args['icon_custom_classes']) ? ',iconized-li' : 'iconized-li';
         }
         if (true === $hover_color_change && false === strpos($icon_args['icon_custom_classes'], 'hover-color-change')) {
             $icon_args['icon_custom_classes'] .= !empty($icon_args['icon_custom_classes']) ? ',hover-color-change' : 'hover-color-change';
         }
         // Override effect and color if needed
         if ('default' !== $hover_effect) {
             $icon_args['icon_transform'] = $hover_effect;
         }
         if ('default' !== $color) {
             $icon_args['icon_color'] = $color;
         }
     }
     // Generate icon html.
     $icon_html = iconize_get_icon($icon_args, $category->taxonomy, $after_icon);
     // Generate iconized link.
     $cat_name = esc_attr($category->name);
     $cat_name = apply_filters('list_cats', $cat_name, $category);
     $link = '<a href="' . esc_url(get_term_link($category)) . '" ';
     if (0 == $use_desc_for_title || empty($category->description)) {
         $link .= 'title="' . esc_attr(sprintf(__('View all posts filed under %s', 'iconize'), $cat_name)) . '"';
     } else {
         $link .= 'title="' . esc_attr(strip_tags(apply_filters('category_description', $category->description, $category))) . '"';
     }
     // Add hover effect class to link if needed.
     if ('link' === $hover_effect_trigger && !empty($icon_html) && !empty($icon_args['icon_transform']) && !empty($hover_effect)) {
         $link .= ' class="iconized-hover-trigger"';
     }
     $link .= '>';
     $link .= $icon_html;
     $link .= $cat_name . '</a>';
     // The rest
     if (!empty($feed_image) || !empty($feed)) {
         $link .= ' ';
         if (empty($feed_image)) {
             $link .= '(';
         }
         $link .= '<a href="' . esc_url(get_term_feed_link($category->term_id, $category->taxonomy, $feed_type)) . '"';
         if (empty($feed)) {
             $alt = ' alt="' . sprintf(__('Feed for all posts filed under %s', 'iconize'), $cat_name) . '"';
         } else {
             $title = ' title="' . $feed . '"';
             $alt = ' alt="' . $feed . '"';
             $name = $feed;
             $link .= $title;
         }
         $link .= '>';
         if (empty($feed_image)) {
             $link .= $name;
         } else {
             $link .= "<img src='{$feed_image}'{$alt}{$title}" . ' />';
         }
         $link .= '</a>';
         if (empty($feed_image)) {
             $link .= ')';
         }
     }
     if (!empty($show_count)) {
         $link .= ' (' . intval($category->count) . ')';
     }
     if ('list' === $args['style']) {
         $output .= "\t<li";
         $class = 'cat-item cat-item-' . $category->term_id;
         if (!empty($current_category)) {
             $_current_category = get_term($current_category, $category->taxonomy);
             if ($category->term_id == $current_category) {
                 $class .= ' current-cat';
             } elseif ($category->term_id == $_current_category->parent) {
                 $class .= ' current-cat-parent';
             }
         }
         $output .= ' class="' . $class . '"';
         $output .= ">{$link}\n";
     } else {
         $output .= "\t{$link}<br />\n";
     }
 }
Example #11
0
/**
 * The template for displaying content type archives
 */
get_header();
?>

		<div id="content" class="grid_8" role="main">

			<?php 
if (have_posts()) {
    ?>

			<div class="category-background">
				<p class="subscribe"><a href="<?php 
    echo esc_url(get_term_feed_link(get_queried_object()));
    ?>
">Follow this topic</a></p>
				<h1 class="page-title"><?php 
    single_term_title();
    ?>
</h1>

				<?php 
    $term_description = term_description();
    if ($term_description) {
        echo '<div class="taxonomy-description">' . $term_description . '</div>';
    }
    ?>
			</div> <!-- /.category-background -->
			
Example #12
0
 function start_el(&$output, $category, $depth, $args)
 {
     extract($args);
     $cat_name = esc_attr($category->name);
     $cat_name = apply_filters('list_cats', $cat_name, $category);
     $link = '<a href="' . esc_attr(get_term_link($category)) . '" ';
     if ($use_desc_for_title == 0 || empty($category->description)) {
         $link .= 'title="' . esc_attr(sprintf(_x('View all posts filed under %s', 'widget categories', LANGUAGE_ZONE), $cat_name)) . '"';
     } else {
         $link .= 'title="' . esc_attr(strip_tags(apply_filters('category_description', $category->description, $category))) . '"';
     }
     $link .= '>';
     $link .= $cat_name;
     if (!empty($show_count)) {
         $link .= '<span>(' . intval($category->count) . ')</span>';
     }
     $link .= '</a>';
     if (!empty($feed_image) || !empty($feed)) {
         $link .= ' ';
         if (empty($feed_image)) {
             $link .= '(';
         }
         $link .= '<a href="' . get_term_feed_link($category->term_id, $category->taxonomy, $feed_type) . '"';
         if (empty($feed)) {
             $alt = ' alt="' . sprintf(_x('Feed for all posts filed under %s', 'widget categories', LANGUAGE_ZONE), $cat_name) . '"';
         } else {
             $title = ' title="' . $feed . '"';
             $alt = ' alt="' . $feed . '"';
             $name = $feed;
             $link .= $title;
         }
         $link .= '>';
         if (empty($feed_image)) {
             $link .= $name;
         } else {
             $link .= "<img src='{$feed_image}'{$alt}{$title}" . ' />';
         }
         $link .= '</a>';
         if (empty($feed_image)) {
             $link .= ')';
         }
     }
     if (!empty($show_date)) {
         $link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp);
     }
     if ('list' == $args['style']) {
         $output .= "\t<li";
         $class = 'cat-item cat-item-' . $category->term_id;
         if ($this->is_first) {
             $class = 'first ' . $class;
             $this->is_first = false;
         }
         if (!empty($current_category)) {
             $_current_category = get_term($current_category, $category->taxonomy);
             if ($category->term_id == $current_category) {
                 $class .= ' current-cat';
             } elseif ($category->term_id == $_current_category->parent) {
                 $class .= ' current-cat-parent';
             }
         }
         $output .= ' class="' . $class . '"';
         $output .= ">{$link}\n";
     } else {
         $output .= "\t{$link}<br />\n";
     }
 }
 /**
  * Get term archive and feed links for each term
  *
  * @param $term
  * @param $taxonomy
  */
 public function setup_term_urls($term, $taxonomy)
 {
     $term_link = get_term_link($term, $taxonomy);
     if (!is_wp_error($term_link)) {
         $this->links[] = $term_link;
     }
     foreach ($this->feeds as $feed) {
         $term_link_feed = get_term_feed_link($term, $taxonomy, $feed);
         if ($term_link_feed) {
             $this->links[] = $term_link_feed;
         }
     }
 }
Example #14
0
 function largo_term_to_label($term)
 {
     return sprintf('<div class="series-label"><h5><a href="%1$s">%2$s</a><a class="rss-link" href="%3$s"></a></h5><p>%4$s</p></div>', get_term_link($term, $term->taxonomy), esc_attr($term->name), get_term_feed_link($term->term_id, $term->taxonomy), esc_attr(strip_tags($term->description)));
 }
 /**
  * @see Walker::start_el()
  * @since 1.3
  *
  * @param string $output Passed by reference. Used to append additional content.
  * @param object $category Category data object.
  * @param int $depth Depth of category in reference to parents.
  * @param array $args
  */
 function start_el(&$output, $category, $depth = 0, $args = array(), $id = 0)
 {
     $output .= '<li><a href="' . esc_url(get_term_link($category)) . '" title="';
     if ($category->description) {
         $output .= esc_attr($category->description);
     } else {
         $output .= sprintf(__('View all posts filed under %s', 'sitetree'), SiteTreeUtilities::escTitleAttr($category->name));
     }
     $output .= '">' . esc_attr($category->name) . '</a>';
     if ($args['feed']) {
         $output .= ' (<a href="' . esc_url(get_term_feed_link($category->term_id)) . '" title="' . SiteTreeUtilities::escTitleAttr($args['feed']) . '">' . esc_attr($args['feed']) . '</a>)';
     }
     if ($args['show_count']) {
         $output .= ' <span class="sitetree-posts-number">(' . (int) $category->count . ')</span>';
     }
 }
 /**
  * Start the element output.
  *
  * @see Walker::start_el()
  *
  * @since 2.1.0
  *
  * @param string $output   Passed by reference. Used to append additional content.
  * @param object $category Category data object.
  * @param int    $depth    Depth of category in reference to parents. Default 0.
  * @param array  $args     An array of arguments. @see wp_list_categories()
  * @param int    $id       ID of the current category.
  */
 function start_el(&$output, $category, $depth = 0, $args = array(), $id = 0)
 {
     extract($args);
     $cat_name = esc_attr($category->name);
     /** This filter is documented in wp-includes/category-template.php */
     $cat_name = apply_filters('list_cats', $cat_name, $category);
     $link = '<a href="' . esc_url(get_term_link($category)) . '" ';
     if ($use_desc_for_title == 0 || empty($category->description)) {
         $link .= 'title="' . esc_attr(sprintf(__('View all listings filed under %s', 'listify'), $cat_name)) . '"';
     } else {
         /**
          * Filter the category description for display.
          *
          * @since 1.2.0
          *
          * @param string $description Category description.
          * @param object $category    Category object.
          */
         $link .= 'title="' . esc_attr(strip_tags(apply_filters('category_description', $category->description, $category))) . '"';
     }
     $link .= '>';
     if (!empty($show_count)) {
         $link .= '<span class="category-count">' . number_format_i18n($category->count) . '</span>';
     }
     $link .= $cat_name . '</a>';
     if (!empty($feed_image) || !empty($feed)) {
         $link .= ' ';
         if (empty($feed_image)) {
             $link .= '(';
         }
         $link .= '<a href="' . esc_url(get_term_feed_link($category->term_id, $category->taxonomy, $feed_type)) . '"';
         if (empty($feed)) {
             $alt = ' alt="' . sprintf(__('Feed for all posts filed under %s', 'listify'), $cat_name) . '"';
         } else {
             $title = ' title="' . $feed . '"';
             $alt = ' alt="' . $feed . '"';
             $name = $feed;
             $link .= $title;
         }
         $link .= '>';
         if (empty($feed_image)) {
             $link .= $name;
         } else {
             $link .= "<img src='{$feed_image}'{$alt}{$title}" . ' />';
         }
         $link .= '</a>';
         if (empty($feed_image)) {
             $link .= ')';
         }
     }
     if ('list' == $args['style']) {
         $output .= "\t<li";
         $class = 'cat-item cat-item-' . $category->term_id;
         if (!empty($current_category)) {
             $_current_category = get_term($current_category, $category->taxonomy);
             if ($category->term_id == $current_category) {
                 $class .= ' current-cat';
             } elseif ($category->term_id == $_current_category->parent) {
                 $class .= ' current-cat-parent';
             }
         }
         $output .= ' class="' . $class . '"';
         $output .= ">{$link}\n";
     } else {
         $output .= "\t{$link}<br />\n";
     }
 }
Example #17
0
 public function start_el(&$output, $category, $depth = 0, $args = array(), $id = 0)
 {
     /** This filter is documented in wp-includes/category-template.php */
     $cat_name = apply_filters('list_cats', esc_attr($category->name), $category);
     $link = '<a href="' . esc_url(get_term_link($category)) . '" ';
     if ($args['use_desc_for_title'] && !empty($category->description)) {
         /**
          * Filter the category description for display.
          *
          * @since 1.2.0
          *
          * @param string $description Category description.
          * @param object $category    Category object.
          */
         $link .= 'title="' . esc_attr(strip_tags(apply_filters('category_description', $category->description, $category))) . '"';
     }
     $link .= '>';
     $link .= $cat_name . '</a>';
     if (!empty($args['feed_image']) || !empty($args['feed'])) {
         $link .= ' ';
         if (empty($args['feed_image'])) {
             $link .= '(';
         }
         $link .= '<a href="' . esc_url(get_term_feed_link($category->term_id, $category->taxonomy, $args['feed_type'])) . '"';
         if (empty($args['feed'])) {
             $alt = ' alt="' . sprintf(__('Feed for all posts filed under %s'), $cat_name) . '"';
         } else {
             $alt = ' alt="' . $args['feed'] . '"';
             $name = $args['feed'];
             $link .= empty($args['title']) ? '' : $args['title'];
         }
         $link .= '>';
         if (empty($args['feed_image'])) {
             $link .= $name;
         } else {
             $link .= "<img src='" . $args['feed_image'] . "'{$alt}" . ' />';
         }
         $link .= '</a>';
         if (empty($args['feed_image'])) {
             $link .= ')';
         }
     }
     if (!empty($args['show_count'])) {
         $link .= ' (' . number_format_i18n($category->count) . ')';
     }
     if ('list' == $args['style']) {
         $output .= "\t<li";
         $class = 'menu-item no-icon menu-item-' . $category->term_id;
         if (get_term_children($category->term_id, $category->taxonomy)) {
             $class .= ' menu-item-has-children';
         }
         if (!empty($args['current_category'])) {
             $_current_category = get_term($args['current_category'], $category->taxonomy);
             if ($category->term_id == $args['current_category']) {
                 $class .= ' current-cat';
             } elseif ($category->term_id == $_current_category->parent) {
                 $class .= ' current-cat-parent';
             }
         }
         $output .= ' class="' . $class . '"';
         $output .= ">{$link}\n";
     } else {
         $output .= "\t{$link}<br />\n";
     }
 }
Example #18
0
 /**
  * Post terms; feed link variations.
  *
  * @since 150218 Refactoring cache clear/purge routines.
  *
  * @param \WP_Post A WordPress post class instance.
  *
  * @param boolean  $include_regex_wildcard_keys Defaults to a `FALSE` value.
  *    If `TRUE`, some associative array keys will be returned also.
  *
  * @return array An array of all feed link variations.
  *
  * @note If `$include_regex_wildcard_keys` is `TRUE`...
  *    This particular method may return some associative keys also.
  *    For string/associative keys, each key is `[feed type]::[regex]`, and the feed link/URL
  *    will contain a single `*` wildcard character where the `[regex]` pattern should go.
  */
 public function post_term_feed_link_variations(\WP_Post $post, $include_regex_wildcard_keys = FALSE)
 {
     $variations = array();
     // Initialize.
     $post_terms = array();
     // Initialize.
     if (!is_array($post_taxonomies = get_object_taxonomies($post, 'objects')) || !$post_taxonomies) {
         return $variations;
     }
     // Nothing to do here; post has no terms.
     foreach ($post_taxonomies as $_post_taxonomy) {
         // Collect terms for each taxonomy.
         if (is_array($_post_taxonomy_terms = wp_get_post_terms($post->ID, $_post_taxonomy->name)) && $_post_taxonomy_terms) {
             $post_terms = array_merge($post_terms, $_post_taxonomy_terms);
         }
     }
     unset($_post_taxonomy, $_post_taxonomy_terms);
     // Housekeeping.
     foreach ($post_terms as $_post_term) {
         foreach ($this->feed_types as $_feed_type) {
             $_term_feed_link = get_term_feed_link($_post_term->term_id, $_post_term->taxonomy, $_feed_type);
             $variations[] = $_term_feed_link;
             // Add this variation; always.
             if ($include_regex_wildcard_keys && $_term_feed_link && strpos($_term_feed_link, '?') === FALSE) {
                 // Quick example: `(?:123|slug)`; to consider both.
                 $_term_id_or_slug = '(?:' . preg_quote($_post_term->term_id, '/') . '|' . preg_quote(preg_replace('/[^a-z0-9\\/.]/i', '-', $_post_term->slug), '/') . ')';
                 // Quick example: `http://www.example.com/tax/term/feed`;
                 //    with a wildcard this becomes: `http://www.example.com/tax/*/feed`.
                 $_term_feed_link_with_wildcard = preg_replace('/\\/[^\\/]+\\/feed([\\/?#]|$)/', '/*/feed' . '${1}', $_term_feed_link);
                 // Quick example: `http://www.example.com/tax/*/feed`;
                 //   becomes: `\/http\/www\.example\.com\/tax\/.*?(?=[\/\-]?(?:123|slug)[\/\-]).*?\/feed`
                 //    ... this covers variations that use: `/tax/term,term/feed/`.
                 //    ... also covers variations that use: `/tax/term/tax/term/feed/`.
                 $variations[$_feed_type . '::.*?(?=[\\/\\-]?' . $_term_id_or_slug . '[\\/\\-]).*?'] = $_term_feed_link_with_wildcard;
                 // NOTE: This may also pick up false-positives. Not much we can do about this.
                 //    For instance, if another feed has the same word/slug in what is actually a longer/different term.
                 //    Or, if another feed has the same word/slug in what is actually the name of a taxonomy.
             }
         }
         unset($_feed_type, $_term_feed_link, $_term_id_or_slug, $_term_feed_link_with_wildcard);
         // Housekeeping.
         if ($this->seo_friendly_permalinks && is_object($_taxonomy = get_taxonomy($_post_term->taxonomy))) {
             if ($_taxonomy->name === 'category') {
                 $_taxonomy_query_var = 'cat';
             } else {
                 $_taxonomy_query_var = $_taxonomy->query_var;
             }
             foreach ($this->feed_types as $_feed_type) {
                 $variations[] = add_query_arg(urlencode_deep(array($_taxonomy_query_var => $_post_term->term_id)), $this->home_url . 'feed/' . urlencode($_feed_type) . '/');
             }
             unset($_feed_type);
             // Housekeeping.
             foreach ($this->feed_types as $_feed_type) {
                 $variations[] = add_query_arg(urlencode_deep(array($_taxonomy_query_var => $_post_term->slug)), $this->home_url . 'feed/' . urlencode($_feed_type) . '/');
             }
             unset($_feed_type);
             // Housekeeping.
         }
         unset($_taxonomy, $_taxonomy_query_var);
         // Housekeeping.
     }
     unset($_post_term);
     // Housekeeping.
     return $variations;
 }
 /**
  * @see Walker::start_el()
  * @since 2.1.0
  *
  * @param string $output Passed by reference. Used to append additional content.
  * @param object $category Category data object.
  * @param int $depth Depth of category in reference to parents.
  * @param array $args
  */
 function start_el(&$output, $category, $depth, $args)
 {
     extract($args);
     // Category name
     $cat_name = esc_attr($category->name);
     $cat_name = apply_filters('list_cats', $cat_name, $category);
     // Category link
     $link = '<a href="' . get_term_link($category, $category->taxonomy) . '" ';
     if ($use_desc_for_title == 0 || empty($category->description)) {
         $link .= 'title="' . sprintf(__('View all posts filed under %s', 'wpms'), $cat_name) . '"';
     } else {
         $link .= 'title="' . esc_attr(strip_tags(apply_filters('category_description', $category->description, $category))) . '"';
     }
     $link .= '>';
     $link .= $cat_name . '</a>';
     if (!empty($feed_image) || !empty($feed)) {
         $link .= ' ';
         if (empty($feed_image)) {
             $link .= '(';
         }
         $link .= '<a href="' . get_term_feed_link($category->term_id, $category->taxonomy, $feed_type) . '"';
         if (empty($feed)) {
             $alt = ' alt="' . sprintf(__('Feed for all posts filed under %s', 'wpms'), $cat_name) . '"';
         } else {
             $title = ' title="' . $feed . '"';
             $alt = ' alt="' . $feed . '"';
             $name = $feed;
             $link .= $title;
         }
         $link .= '>';
         if (empty($feed_image)) {
             $link .= $name;
         } else {
             $link .= '<img src="' . $feed_image . '"' . $alt . $title . ' />';
         }
         $link .= '</a>';
         if (empty($feed_image)) {
             $link .= ')';
         }
     }
     if (isset($show_count) && $show_count) {
         $link .= ' (' . intval($category->count) . ')';
     }
     if (isset($show_date) && $show_date) {
         $link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp);
     }
     // Output the Parents (Articles (seperator) Sub Cat (seperator) Another Sub Cat)
     $parents = explode('|', get_category_parents($category->term_id, true, '|', false));
     $catParents = '';
     for ($i = 0; $i < sizeof($parents) - 1; $i++) {
         $catParents .= $parents[$i];
         if ($i + 2 != sizeof($parents)) {
             $catParents .= " &raquo; ";
         }
     }
     if ('list' == $args['style']) {
         $parent = "\t<li><h3>" . $catParents . "</h3>\n";
     } else {
         $parent = "\t<h3>" . $catParents . "</h3>\n";
     }
     $parentPosts = "";
     $parentPostsCount = 0;
     // Get all children
     $children = get_term_children($category->term_id, 'category');
     // Get all posts of current category
     $posts = get_posts('suppress_filters=0&numberposts=-1&category=' . $category->term_id);
     if (sizeof($posts) > 0) {
         foreach ($posts as $p) {
             // Exclude children which are assigned to a 'deeper' category
             $postPresent = false;
             if (sizeof($children) > 0) {
                 if (in_category($children, $p)) {
                     $postPresent = true;
                 }
             }
             if ($postPresent) {
                 continue;
             }
             $parentPostsCount += 1;
             if ('list' == $args['style']) {
                 $parentPosts .= '<li><a href="' . get_permalink($p->ID) . '">' . $p->post_title . '</a></li>';
             } else {
                 $parentPosts .= '<a href="' . get_permalink($p->ID) . '">' . $p->post_title . '</a>';
             }
         }
         if ($parentPostsCount > 0) {
             if ('list' == $args['style']) {
                 $output .= $parent . "\n<ul>" . $parentPosts . "\n</ul>";
             } else {
                 $output .= $parent . "\n" . $parentPosts . "\n";
             }
         }
     }
 }
 function start_el(&$output, $category, $depth = 0, $args = array(), $id = 0)
 {
     if ($this->type == "list") {
         extract($args);
         $cat_name = esc_attr($sf_name);
         $cat_name = apply_filters('list_cats', $cat_name, $category);
         $link = '<a href="' . esc_url(get_term_link($category)) . '" ';
         if ($use_desc_for_title == 0 || empty($category->description)) {
             $link .= 'title="' . esc_attr(sprintf(__('View all posts filed under %s'), $cat_name)) . '"';
         } else {
             $link .= 'title="' . esc_attr(strip_tags(apply_filters('category_description', $category->description, $category))) . '"';
         }
         $link .= '>';
         $link .= $cat_name . '</a>';
         if (!empty($feed_image) || !empty($feed)) {
             $link .= ' ';
             if (empty($feed_image)) {
                 $link .= '(';
             }
             $link .= '<a href="' . esc_url(get_term_feed_link($category->term_id, $category->taxonomy, $feed_type)) . '"';
             if (empty($feed)) {
                 $alt = ' alt="' . sprintf(__('Feed for all posts filed under %s'), $cat_name) . '"';
             } else {
                 $title = ' title="' . $feed . '"';
                 $alt = ' alt="' . $feed . '"';
                 $name = $feed;
                 $link .= $title;
             }
             $link .= '>';
             if (empty($feed_image)) {
                 $link .= $name;
             } else {
                 $link .= "<img src='{$feed_image}'{$alt}{$title}" . ' />';
             }
             $link .= '</a>';
             if (empty($feed_image)) {
                 $link .= ')';
             }
         }
         if (!empty($show_count)) {
             $link .= ' (' . intval($category->count) . ')';
         }
         if ('list' == $args['style']) {
             $output .= "\t<li";
             $class = 'cat-item cat-item-' . $category->term_id;
             if (!empty($current_category)) {
                 $_current_category = get_term($current_category, $category->taxonomy);
                 if ($category->term_id == $current_category) {
                     $class .= ' current-cat';
                 } elseif ($category->term_id == $_current_category->parent) {
                     $class .= ' current-cat-parent';
                 }
             }
             $output .= ' class="' . $class . '"';
             $output .= ">{$link}\n";
         } else {
             $output .= "\t{$link}<br />\n";
         }
     } else {
         if ($this->type == "checkbox" || $this->type == "radio") {
             extract($args);
             $cat_name = esc_attr($category->name);
             $cat_id = esc_attr($category->term_id);
             $cat_name = apply_filters('list_cats', $cat_name, $category);
             //check a default has been set
             $checked = "";
             if ($defaults) {
                 $noselected = count($this->defaults);
                 if ($noselected > 0 && is_array($defaults)) {
                     foreach ($defaults as $defaultid) {
                         if ($defaultid == $cat_id) {
                             $checked = ' checked="checked"';
                         }
                     }
                 }
             }
             $link = "<label><input type='" . $this->type . "' name='" . $sf_name . "[]' value='" . $cat_id . "'" . $checked . " /> " . $cat_name;
             if (!empty($show_count)) {
                 $link .= ' (' . intval($category->count) . ')';
             }
             $link .= "</label>";
             if ('list' == $args['style']) {
                 $output .= "\t<li";
                 $class = 'cat-item cat-item-' . $category->term_id;
                 if (!empty($current_category)) {
                     $_current_category = get_term($current_category, $category->taxonomy);
                     if ($category->term_id == $current_category) {
                         $class .= ' current-cat';
                     } elseif ($category->term_id == $_current_category->parent) {
                         $class .= ' current-cat-parent';
                     }
                 }
                 $output .= ' class="' . $class . '"';
                 $output .= ">{$link}\n";
             } else {
                 $output .= "\t{$link}<br />\n";
             }
         } else {
             if ($this->type == "multiselect") {
                 extract($args);
                 $cat_name = esc_attr($category->name);
                 $cat_id = esc_attr($category->term_id);
                 $cat_name = apply_filters('list_cats', $cat_name, $category);
                 //check a default has been set
                 $checked = "";
                 if ($defaults) {
                     $noselected = count($this->defaults);
                     if ($noselected > 0 && is_array($defaults)) {
                         foreach ($defaults as $defaultid) {
                             if ($defaultid == $cat_id) {
                                 $checked = ' selected="selected"';
                             }
                         }
                     }
                 }
                 /* Custom  depth calculations! :/ */
                 if ($category->parent == 0) {
                     //then this has no parent so reset depth
                     $this->multidepth = 0;
                 } else {
                     if ($category->parent == $this->multilastid) {
                         $this->multidepth++;
                         $this->multilastdepthchange = $this->multilastid;
                     } else {
                         if ($category->parent == $this->multilastdepthchange) {
                             //then this is also a child with the same parent so don't change depth
                         } else {
                             //then this has a different parent so must be lower depth
                             if ($this->multidepth > 0) {
                                 $this->multidepth--;
                             }
                         }
                     }
                 }
                 $pad = str_repeat('&nbsp;', $this->multidepth * 3);
                 $link = "<option class=\"level-" . $this->multidepth . "\" value='" . $cat_id . "'{$checked} />" . $pad . $cat_name;
                 if (!empty($show_count)) {
                     $link .= '&nbsp;&nbsp;(' . intval($category->count) . ')';
                 }
                 $link .= "</option>";
                 $output .= "\t{$link}\n";
                 $this->multilastid = $cat_id;
                 /*
                 			$pad = str_repeat('&nbsp;', $depth * 3);
                 
                 			$output .= "\t<option class=\"level-$depth\" value=\"".$category->term_id."\"";
                 			$cat_name = apply_filters('list_cats', $category->sf_name, $category);
                 			if ( $category->term_id == $args['selected'] )
                 				$output .= ' selected="selected"';
                 			$output .= '>';
                 			$output .= $pad.$cat_name;
                 			if ( $args['show_count'] )
                 				$output .= '&nbsp;&nbsp;('. $category->count .')';
                 			$output .= "</option>\n";*/
             }
         }
     }
 }
 /** @see WP_Widget::widget */
 function widget($args, $instance)
 {
     global $podPress, $wp_version;
     extract($args);
     $title = apply_filters('widget_title', $instance['title']);
     $feed_icon = '<img src="' . get_option('siteurl') . '/' . WPINC . '/images/rss.png" class="podpress_feed_icon" alt="" />';
     echo $before_widget;
     echo $before_title . $title . $after_title;
     echo '<ul class="podpress_feed_buttons_list">' . "\n";
     switch ($instance['buttons-or-text']) {
         default:
         case 'buttons':
             if ($instance['itunes']) {
                 // for more info: http://www.apple.com/itunes/podcasts/specs.html#linking
                 if ($instance['iprot']) {
                     echo ' <li><a href="itpc://' . preg_replace('/^https?:\\/\\//i', '', $podPress->settings['podcastFeedURL']) . '"';
                 } else {
                     echo ' <li><a href="http://www.itunes.com/podcast?id=' . $podPress->settings['iTunes']['FeedID'] . '"';
                 }
                 if (FALSE == empty($instance['itunes_buttonurl'])) {
                     echo ' title="' . __('Subscribe to the Podcast Feed with iTunes', 'podpress') . '"><img src="' . $instance['itunes_buttonurl'] . '" class="podpress_feed_buttons" alt="' . __('Subscribe with iTunes', 'podpress') . '" /></a></li>' . "\n";
                 } else {
                     echo ' title="' . __('Subscribe to the Podcast Feed with iTunes', 'podpress') . '"><img src="' . podPress_url() . 'images/itunes.png" class="podpress_feed_buttons" alt="' . __('Subscribe with iTunes', 'podpress') . '" /></a></li>' . "\n";
                 }
             }
             // podPress feeds:
             if (is_array($instance['podpressfeeds']) and FALSE == empty($instance['podpressfeeds'])) {
                 foreach ($instance['podpressfeeds'] as $feed_slug => $feed_options) {
                     if ('yes' === $feed_options['use'] and is_array($podPress->settings['podpress_feeds'])) {
                         foreach ($podPress->settings['podpress_feeds'] as $feed) {
                             if ($feed_slug === $feed['slug'] and TRUE === $feed['use']) {
                                 if (FALSE == empty($feed_options['altfeedurl'])) {
                                     $feed_link = $feed_options['altfeedurl'];
                                 } else {
                                     $feed_link = get_feed_link($feed_slug);
                                 }
                                 if (FALSE == empty($feed['slug'])) {
                                     $descr = stripslashes($feed['descr']);
                                 } else {
                                     $descr = __('Subscribe to this Feed with any feed reader', 'podpress');
                                 }
                                 if (FALSE == empty($feed_options['buttonurl'])) {
                                     echo '	<li><a href="' . $feed_link . '" title="' . esc_attr($descr) . '"><img src="' . $feed_options['buttonurl'] . '" class="podpress_feed_buttons" alt="' . esc_attr(stripslashes($feed['name'])) . '" /></a></li>' . "\n";
                                 } else {
                                     echo '	<li><a href="' . $feed_link . '" title="' . esc_attr($descr) . '">' . $feed_icon . ' ' . stripslashes($feed['name']) . '</a></li>' . "\n";
                                 }
                             }
                         }
                     }
                 }
             }
             if ($instance['posts']) {
                 if (FALSE == empty($instance['posts_altfeedurl'])) {
                     $feedlink = $instance['posts_altfeedurl'];
                 } else {
                     $feedlink = get_bloginfo('rss2_url');
                 }
                 if (FALSE == empty($instance['posts_buttonurl'])) {
                     echo '	<li><a href="' . $feedlink . '" title="' . __('Subscribe to the main RSS Feed with any feed reader', 'podpress') . '"><img src="' . $instance['posts_buttonurl'] . '" class="podpress_feed_buttons" alt="' . __('Subscribe to the RSS Feed', 'podpress') . '" /></a></li>' . "\n";
                 } else {
                     echo '	<li><a href="' . $feedlink . '" title="' . __('Subscribe to the main RSS Feed with any feed reader', 'podpress') . '"><img src="' . podPress_url() . 'images/feed_button-rss-blog.png" class="podpress_feed_buttons" alt="' . __('Subscribe to the RSS Feed', 'podpress') . '" /></a></li>' . "\n";
                 }
             }
             if ($instance['comments']) {
                 if (FALSE == empty($instance['comments_altfeedurl'])) {
                     $feedlink = $instance['comments_altfeedurl'];
                 } else {
                     $feedlink = get_bloginfo('comments_rss2_url');
                 }
                 if (FALSE == empty($instance['comments_buttonurl'])) {
                     echo '	<li><a href="' . $feedlink . '" title="' . __('Subscribe to the comments RSS Feed with any feed reader', 'podpress') . '"><img src="' . $instance['comments_buttonurl'] . '" class="podpress_feed_buttons" alt="' . __('Subscribe to the comments RSS Feed', 'podpress') . '" /></a></li>' . "\n";
                 } else {
                     echo '	<li><a href="' . $feedlink . '" title="' . __('Subscribe to the comments RSS Feed with any feed reader', 'podpress') . '"><img src="' . podPress_url() . 'images/feed_button-rss-comments.png" class="podpress_feed_buttons" alt="' . __('Subscribe to the comments RSS Feed', 'podpress') . '" /></a></li>' . "\n";
                 }
             }
             if ($instance['entries-atom']) {
                 if (FALSE == empty($instance['entries-atom_altfeedurl'])) {
                     $feedlink = $instance['entries-atom_altfeedurl'];
                 } else {
                     $feedlink = get_bloginfo('atom_url');
                 }
                 if (FALSE == empty($instance['entries-atom_buttonurl'])) {
                     echo '	<li><a href="' . $feedlink . '" title="' . __('Subscribe to the main ATOM Feed with any feed reader', 'podpress') . '"><img src="' . $instance['entries-atom_buttonurl'] . '" class="podpress_feed_buttons" alt="' . __('Subscribe to the ATOM Feed', 'podpress') . '" /></a></li>' . "\n";
                 } else {
                     echo '	<li><a href="' . $feedlink . '" title="' . __('Subscribe to the main ATOM Feed with any feed reader', 'podpress') . '"><img src="' . podPress_url() . 'images/feed_button-atom-blog.png" class="podpress_feed_buttons" alt="' . __('Subscribe to the ATOM Feed', 'podpress') . '" /></a></li>' . "\n";
                 }
             }
             if ($instance['comments-atom']) {
                 if (FALSE === empty($instance['comments-atom_altfeedurl'])) {
                     $feedlink = $instance['comments-atom_altfeedurl'];
                 } else {
                     $feedlink = get_bloginfo('comments_atom_url');
                 }
                 if (FALSE == empty($instance['comments-atom_buttonurl'])) {
                     echo '	<li><a href="' . $feedlink . '" title="' . __('Subscribe to the comments ATOM Feed with any feed reader', 'podpress') . '"><img src="' . $instance['comments-atom_buttonurl'] . '" class="podpress_feed_buttons" alt="' . __('Subscribe to the comments ATOM Feed', 'podpress') . '" /></a></li>' . "\n";
                 } else {
                     echo '	<li><a href="' . $feedlink . '" title="' . __('Subscribe to the comments ATOM Feed with any feed reader', 'podpress') . '"><img src="' . podPress_url() . 'images/feed_button-atom-comments.png" class="podpress_feed_buttons" alt="' . __('Subscribe to the comments ATOM Feed', 'podpress') . '" /></a></li>' . "\n";
                 }
             }
             if (is_array($instance['catcast']) and FALSE == empty($instance['catcast'])) {
                 foreach ($instance['catcast'] as $cat_id => $catcast_options) {
                     if ('yes' === $catcast_options['use']) {
                         if (FALSE == empty($catcast_options['altfeedurl'])) {
                             $cat_feed_link = $catcast_options['altfeedurl'];
                         } else {
                             if (TRUE == version_compare($wp_version, '2.9.3', '>')) {
                                 $cat_feed_link = get_term_feed_link($cat_id);
                             } else {
                                 $cat_feed_link = get_category_feed_link($cat_id);
                             }
                         }
                         if (FALSE == empty($catcast_options['buttonurl'])) {
                             echo '	<li><a href="' . $cat_feed_link . '" title="' . __('Subscribe to this Category RSS Feed with any feed reader', 'podpress') . '"><img src="' . $catcast_options['buttonurl'] . '" class="podpress_feed_buttons" alt="' . esc_attr(sprintf(__('Category "%1$s" RSS Feed', 'podpress'), get_cat_name($cat_id))) . '" /></a></li>' . "\n";
                         } else {
                             echo '	<li><a href="' . $cat_feed_link . '" title="' . __('Subscribe to this Category RSS Feed with any feed reader', 'podpress') . '">' . $feed_icon . ' ' . sprintf(__('Category "%1$s" RSS Feed', 'podpress'), get_cat_name($cat_id)) . '</a></li>' . "\n";
                         }
                     }
                 }
             }
             break;
         case 'text':
             if ($instance['itunes']) {
                 // for more info: http://www.apple.com/itunes/podcasts/specs.html#linking
                 if ($instance['iprot']) {
                     echo ' <li><a href="itpc://' . preg_replace('/^https?:\\/\\//i', '', $podPress->settings['podcastFeedURL']) . '"';
                 } else {
                     echo ' <li><a href="http://www.itunes.com/podcast?id=' . $podPress->settings['iTunes']['FeedID'] . '"';
                 }
                 echo ' title="' . __('Subscribe to the Podcast Feed with iTunes', 'podpress') . '">' . $feed_icon . ' ' . __('Subscribe with iTunes', 'podpress') . '</a></li>' . "\n";
             }
             // podPress feeds:
             if (is_array($instance['podpressfeeds']) and FALSE == empty($instance['podpressfeeds'])) {
                 foreach ($instance['podpressfeeds'] as $feed_slug => $feed_options) {
                     if ('yes' === $feed_options['use'] and is_array($podPress->settings['podpress_feeds'])) {
                         foreach ($podPress->settings['podpress_feeds'] as $feed) {
                             if ($feed_slug === $feed['slug'] and TRUE === $feed['use']) {
                                 if (FALSE == empty($feed_options['altfeedurl'])) {
                                     $feed_link = $feed_options['altfeedurl'];
                                 } else {
                                     $feed_link = get_feed_link($feed_slug);
                                 }
                                 if (FALSE == empty($feed['slug'])) {
                                     $descr = stripslashes($feed['descr']);
                                 } else {
                                     $descr = __('Subscribe to this Feed with any feed reader', 'podpress');
                                 }
                                 echo '	<li><a href="' . $feed_link . '" title="' . esc_attr($descr) . '">' . $feed_icon . ' ' . stripslashes($feed['name']) . '</a></li>' . "\n";
                             }
                         }
                     }
                 }
             }
             if ($instance['posts']) {
                 if (FALSE == empty($instance['posts_altfeedurl'])) {
                     $feedlink = $instance['posts_altfeedurl'];
                 } else {
                     $feedlink = get_bloginfo('rss2_url');
                 }
                 echo '	<li><a href="' . $feedlink . '" title="' . __('Subscribe to the main RSS Feed with any feed reader', 'podpress') . '">' . $feed_icon . ' ' . __('Entries RSS Feed', 'podpress') . '</a></li>' . "\n";
             }
             if ($instance['comments']) {
                 if (FALSE == empty($instance['comments_altfeedurl'])) {
                     $feedlink = $instance['comments_altfeedurl'];
                 } else {
                     $feedlink = get_bloginfo('comments_rss2_url');
                 }
                 echo '	<li><a href="' . $feedlink . '" title="' . __('Subscribe to the comments RSS Feed with any feed reader', 'podpress') . '">' . $feed_icon . ' ' . __('Comments RSS Feed', 'podpress') . '</a></li>' . "\n";
             }
             if ($instance['entries-atom']) {
                 if (FALSE == empty($instance['entries-atom_altfeedurl'])) {
                     $feedlink = $instance['entries-atom_altfeedurl'];
                 } else {
                     $feedlink = get_bloginfo('atom_url');
                 }
                 echo '	<li><a href="' . $feedlink . '" title="' . __('Subscribe to the main ATOM Feed with any feed reader', 'podpress') . '">' . $feed_icon . ' ' . __('Entries ATOM Feed', 'podpress') . '</a></li>' . "\n";
             }
             if ($instance['comments-atom']) {
                 if (FALSE === empty($instance['comments-atom_altfeedurl'])) {
                     $feedlink = $instance['comments-atom_altfeedurl'];
                 } else {
                     $feedlink = get_bloginfo('comments_atom_url');
                 }
                 echo '	<li><a href="' . $feedlink . '" title="' . __('Subscribe to the comments ATOM Feed with any feed reader', 'podpress') . '">' . $feed_icon . ' ' . __('Comments ATOM Feed', 'podpress') . '</a></li>' . "\n";
             }
             if (is_array($instance['catcast']) and FALSE == empty($instance['catcast'])) {
                 foreach ($instance['catcast'] as $cat_id => $catcast_options) {
                     if ('yes' === $catcast_options['use']) {
                         if (FALSE == empty($catcast_options['altfeedurl'])) {
                             $cat_feed_link = $catcast_options['altfeedurl'];
                         } else {
                             if (TRUE == version_compare($wp_version, '2.9.3', '>')) {
                                 $cat_feed_link = get_term_feed_link($cat_id);
                             } else {
                                 $cat_feed_link = get_category_feed_link($cat_id);
                             }
                         }
                         echo '	<li><a href="' . $cat_feed_link . '" title="' . __('Subscribe to this Category RSS Feed with any feed reader', 'podpress') . '">' . $feed_icon . ' ' . sprintf(__('Category "%1$s" RSS Feed', 'podpress'), get_cat_name($cat_id)) . '</a></li>' . "\n";
                     }
                 }
             }
             break;
     }
     echo "</ul>\n";
     echo $after_widget;
 }
function powerpress_admin_taxonomyfeeds()
{
    $General = powerpress_get_settings('powerpress_general');
    ?>
<h2><?php 
    echo __('Taxonomy Podcasting', 'powerpress');
    ?>
</h2>
<p>
	<?php 
    echo __('Taxonomy Podcasting adds custom podcast settings to specific taxonomy feeds.', 'powerpress');
    ?>
</p>
<style type="text/css">
.column-url {
	width: 40%;
}
.column-name {
	width: 30%;
}
.column-feed-slug {
	width: 15%;
}
.column-episode-count {
	width: 15%;
}
.category-list {
	width: 100%;
}
.form-field select {
	width: 95%;
}
</style>
<div id="col-container">

<div id="col-right">
<table class="widefat fixed" cellspacing="0">
	<thead>
	<tr>
<?php 
    print_column_headers('powerpressadmin_taxonomyfeeds');
    ?>
	</tr>
	</thead>

	<tfoot>
	<tr>
<?php 
    print_column_headers('powerpressadmin_taxonomyfeeds', false);
    ?>
	</tr>
	</tfoot>
	<tbody>
<?php 
    $PowerPressTaxonomies = get_option('powerpress_taxonomy_podcasting');
    if (empty($PowerPressTaxonomies)) {
        $PowerPressTaxonomies = array();
    }
    $count = 0;
    while (list($tt_id, $null) = each($PowerPressTaxonomies)) {
        $taxonomy_type = '';
        $term_ID = '';
        global $wpdb;
        $term_info = $wpdb->get_results("SELECT term_id, taxonomy FROM {$wpdb->term_taxonomy} WHERE term_taxonomy_id = {$tt_id}", ARRAY_A);
        if (!empty($term_info[0]['term_id'])) {
            $term_ID = $term_info[0]['term_id'];
            $taxonomy_type = $term_info[0]['taxonomy'];
        } else {
            continue;
            // we didn't find this taxonomy relationship
        }
        //	var_dump($term_info);
        //$category = get_category_to_edit($cat_ID);
        $term_object = get_term($term_ID, $taxonomy_type, OBJECT, 'edit');
        $columns = powerpress_admin_taxonomyfeeds_columns();
        $hidden = array();
        if ($count % 2 == 0) {
            echo '<tr valign="middle" class="alternate">';
        } else {
            echo '<tr valign="middle">';
        }
        $edit_link = admin_url('admin.php?page=powerpress/powerpressadmin_taxonomyfeeds.php&amp;action=powerpress-edittaxonomyfeed&amp;term=' . $term_ID . '&taxonomy=' . $taxonomy_type . '&amp;ttid=' . $tt_id);
        $feed_title = $term_object->name;
        $url = get_term_feed_link($term_ID, $taxonomy_type, 'rss2');
        $short_url = str_replace('http://', '', $url);
        $short_url = str_replace('www.', '', $short_url);
        if (strlen($short_url) > 35) {
            $short_url = substr($short_url, 0, 32) . '...';
        }
        foreach ($columns as $column_name => $column_display_name) {
            $class = "class=\"column-{$column_name}\"";
            //$short_url = '';
            switch ($column_name) {
                case 'feed-slug':
                    echo "<td {$class}>{$term_object->slug}";
                    echo "</td>";
                    break;
                case 'name':
                    echo '<td ' . $class . '><strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr(sprintf(__('Edit "%s"', 'powerpress'), $feed_title)) . '">' . esc_attr($feed_title) . '</a></strong><br />';
                    $actions = array();
                    $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit', 'powerpress') . '</a>';
                    $actions['remove'] = "<a class='submitdelete' href='" . admin_url() . wp_nonce_url("admin.php?page=powerpress/powerpressadmin_taxonomyfeeds.php&amp;action=powerpress-delete-taxonomy-feed&amp;ttid={$tt_id}", 'powerpress-delete-taxonomy-feed-' . $tt_id) . "' onclick=\"if ( confirm('" . esc_js(sprintf(__("You are about to remove podcast settings for taxonomy '%s'\n  'Cancel' to stop, 'OK' to delete.", 'powerpress'), esc_attr($feed_title))) . "') ) { return true;}return false;\">" . __('Remove', 'powerpress') . "</a>";
                    $action_count = count($actions);
                    $i = 0;
                    echo '<div class="row-actions">';
                    foreach ($actions as $action => $linkaction) {
                        ++$i;
                        $i == $action_count ? $sep = '' : ($sep = ' | ');
                        echo '<span class="' . $action . '">' . $linkaction . $sep . '</span>';
                    }
                    echo '</div>';
                    echo '</td>';
                    break;
                case 'url':
                    echo "<td {$class}><a href='{$url}' title='" . esc_attr(sprintf(__('Visit %s', 'powerpress'), $feed_title)) . "' target=\"_blank\">{$short_url}</a>";
                    echo '<div class="row-actions">';
                    if (defined('POWERPRESS_FEEDVALIDATOR_URL')) {
                        echo '<span class="' . $action . '"><a href="' . POWERPRESS_FEEDVALIDATOR_URL . urlencode(str_replace('&amp;', '&', $url)) . '" target="_blank">' . __('Validate Feed', 'powerpress') . '</a></span>';
                    }
                    echo '</div>';
                    echo "</td>";
                    break;
                case 'episode-count':
                    echo "<td {$class}>{$episode_total}";
                    echo "</td>";
                    break;
                case 'taxonomy':
                    echo "<td {$class}>{$taxonomy_type}";
                    echo "</td>";
                    break;
                default:
                    break;
            }
        }
        echo "\n    </tr>\n";
        $count++;
    }
    ?>
	</tbody>
</table>
</div> <!-- col-right -->

<div id="col-left">
<div class="col-wrap">
<div class="form-wrap">
<h3><?php 
    echo __('Add Podcasting to Existing Taxonomy Term', 'powerpress');
    ?>
</h3>
<?php 
    $current_taxonomy = isset($_GET['taxonomy']) ? $_GET['taxonomy'] : (isset($_POST['taxonomy']) ? $_POST['taxonomy'] : '');
    if (empty($current_taxonomy)) {
        ?>
<div class="form-field form-required">
<label><?php 
        echo __('Step 1 - Select Taxonomy', 'powerpress');
        ?>
</label>
<select id="powerpress_taxonomy_select" name="taxonomy" style="width: 95%;">
	<option value=""><?php 
        echo __('Select Taxonomy', '');
        ?>
</option>
<?php 
        $taxonomies = get_taxonomies('', 'names');
        while (list($null, $taxonomy) = each($taxonomies)) {
            if ($taxonomy == 'category') {
                continue;
            }
            $taxonomy = htmlspecialchars($taxonomy);
            echo "\t<option value=\"{$taxonomy}\"" . ($current_taxonomy == $taxonomy ? ' selected' : '') . ">{$taxonomy}</option>\n";
        }
        ?>

<?php 
        ?>
</select>
</div>
<p class="submit"><input type="submit" class="button" name="select_taxonomy" value="<?php 
        echo __('Select Taxonomy Term', 'powerpress');
        ?>
" /></p>

<?php 
    }
    if (!empty($current_taxonomy)) {
        ?>
<input type="hidden" name="action" value="powerpress-addtaxonomyfeed" />
<input type="hidden" name="taxonomy" value="<?php 
        echo esc_attr($current_taxonomy);
        ?>
" />
<?php 
        //wp_original_referer_field(true, 'previous');
        wp_nonce_field('powerpress-add-taxonomy-feed');
        ?>
<div class="form-field form-required">
	<label for="term"><?php 
        echo __('Step 2 - Select Taxonomy Term', 'powerpress');
        ?>
</label>
<?php 
        wp_dropdown_categories(array('class' => '', 'show_option_none' => __('Select Term', 'powerpress'), 'orderby' => 'name', 'hide_empty' => 0, 'hierarchical' => 1, 'name' => 'term', 'id' => 'term_id', 'taxonomy' => $current_taxonomy));
        ?>
</div>

<p class="submit">
	<input type="submit" class="button" name="add_podcasting" value="<?php 
        echo __('Add Podcast Settings to Term', 'powerpress');
        ?>
" /> &nbsp; 
	<input type="submit" class="button" name="cancel" value="<?php 
        echo __('Cancel', 'powerpress');
        ?>
" />
</p>
<?php 
    }
    ?>

</div>
</div>

</div> <!-- col-left -->

</div> <!-- col-container -->

<?php 
}
Example #23
0
 public function clean_permalink($headers)
 {
     if (is_robots() || get_query_var('sitemap')) {
         return;
     }
     global $wp_query;
     $options = get_wpseo_options();
     // Recreate current URL
     $cururl = 'http';
     if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
         $cururl .= "s";
     }
     $cururl .= "://";
     if ($_SERVER["SERVER_PORT"] != "80") {
         $cururl .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
     } else {
         $cururl .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
     }
     $properurl = '';
     if (is_singular()) {
         global $post;
         if (empty($post)) {
             $post = $wp_query->get_queried_object();
         }
         $properurl = get_permalink($post->ID);
         $page = get_query_var('page');
         if ($page && $page != 1) {
             $post = get_post($post->ID);
             $page_count = substr_count($post->post_content, '<!--nextpage-->');
             if ($page > $page_count + 1) {
                 $properurl = user_trailingslashit(trailingslashit($properurl) . ($page_count + 1));
             } else {
                 $properurl = user_trailingslashit(trailingslashit($properurl) . $page);
             }
         }
         // Fix reply to comment links, whoever decided this should be a GET variable?
         $result = preg_match('/(\\?replytocom=[^&]+)/', $_SERVER["REQUEST_URI"], $matches);
         if ($result) {
             $properurl .= str_replace('?replytocom=', '#comment-', $matches[0]);
         }
         // Prevent cleaning out posts & page previews for people capable of viewing them
         if (isset($_GET['preview']) && isset($_GET['preview_nonce']) && current_user_can('edit_post')) {
             $properurl = '';
         }
     } else {
         if (is_front_page()) {
             if ('posts' == get_option('show_on_front') && is_home()) {
                 $properurl = get_bloginfo('url') . '/';
             } elseif ('page' == get_option('show_on_front')) {
                 $properurl = get_permalink(get_option('page_on_front'));
             }
         } else {
             if (is_category() || is_tag() || is_tax()) {
                 $term = $wp_query->get_queried_object();
                 if (is_feed()) {
                     $properurl = get_term_feed_link($term, $term->taxonomy);
                 } else {
                     $properurl = get_term_link($term, $term->taxonomy);
                 }
             } else {
                 if (is_search()) {
                     $s = preg_replace('/(%20|\\+)/', ' ', get_search_query());
                     $properurl = get_bloginfo('url') . '/?s=' . rawurlencode($s);
                 } else {
                     if (is_404()) {
                         if (function_exists('is_multisite') && is_multisite() && !is_subdomain_install() && is_main_site()) {
                             if ($cururl == get_bloginfo('url') . '/blog/' || $cururl == get_bloginfo('url') . '/blog') {
                                 if (get_option('show_on_front') == 'page' && get_option('page_for_posts') != 0) {
                                     $properurl = get_permalink(get_option('page_for_posts'));
                                 } else {
                                     $properurl = get_bloginfo('url') . '/';
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     if (!empty($properurl) && $wp_query->query_vars['paged'] != 0 && $wp_query->post_count != 0) {
         if (is_search()) {
             $properurl = get_bloginfo('url') . '/page/' . $wp_query->query_vars['paged'] . '/?s=' . rawurlencode($s);
         } else {
             $properurl = user_trailingslashit(trailingslashit($properurl) . 'page/' . $wp_query->query_vars['paged']);
         }
     }
     // Prevent cleaning out the WP Subscription managers interface for everyone
     foreach (array('wp-subscription-manager') as $get) {
         if (isset($_GET[$get])) {
             $properurl = '';
         }
     }
     // Allow plugins to register their own variables not to clean
     $whitelisted_extravars = apply_filters('wpseo_whitelist_permalink_vars', array());
     if (isset($options['cleanpermalink-googlesitesearch']) && $options['cleanpermalink-googlesitesearch']) {
         // Prevent cleaning out Google Site searches
         $whitelisted_extravars = array_merge($whitelisted_extravars, array('q', 'cx', 'debug', 'cof', 'ie', 'sa'));
     }
     if (isset($options['cleanpermalink-googlecampaign']) && $options['cleanpermalink-googlecampaign']) {
         // Prevent cleaning out Google Analytics campaign variables
         $whitelisted_extravars = array_merge($whitelisted_extravars, array('utm_campaign', 'utm_medium', 'utm_source', 'utm_content', 'utm_term'));
     }
     if (isset($options['cleanpermalink-extravars']) && strlen($options['cleanpermalink-extravars']) > 0) {
         $whitelisted_extravars = array_merge($whitelisted_extravars, explode(',', $options['cleanpermalink-extravars']));
     }
     foreach ($whitelisted_extravars as $get) {
         if (isset($_GET[trim($get)])) {
             $properurl = '';
         }
     }
     if (!empty($properurl) && $cururl != $properurl) {
         wp_redirect($properurl, 301);
         exit;
     }
 }
 function edit_category_form($input)
 {
     global $wp_version, $action;
     //~ echo "\n<pre>\n";
     //~ var_dump('in function edit_category_form');
     //~ var_dump($input);
     //~ var_dump($input->taxonomy);
     //~ var_dump($action);
     //~ var_dump($_GET['action']);
     //~ var_dump($wp_version);
     //~ echo "\n</pre>\n";
     if ('edit' == $_GET['action'] and TRUE == version_compare($wp_version, '2.7', '>=') or 'editedcat' == $action) {
         // show the following form only when an existing category is going to be edited.
         if (FALSE === isset($input->taxonomy) or TRUE === empty($input->taxonomy) or 'post_tag' !== $input->taxonomy and 'category' !== $input->taxonomy) {
             $taxonomy = 'misc';
             $taxonomy_str = __('Taxonomy', 'podpress');
         } else {
             $taxonomy = $input->taxonomy;
             switch ($taxonomy) {
                 case 'post_tag':
                     $taxonomy_str = __('Tag', 'podpress');
                     break;
                 case 'category':
                     $taxonomy_str = __('Category', 'podpress');
                     break;
             }
         }
         //~ printphpnotices_var_dump('print edit_'.$taxonomy.'_form');
         //~ printphpnotices_var_dump($input);
         $data = podPress_get_option('podPress_' . $taxonomy . '_' . $input->term_id);
         $blog_charset = get_bloginfo('charset');
         if (empty($data['podcastFeedURL'])) {
             if (TRUE == version_compare($wp_version, '2.9.3', '>')) {
                 // since WP 3.0 the cat_ID isreplaced by tag_ID
                 $data['podcastFeedURL'] = get_term_feed_link($input->term_id, $taxonomy);
             } elseif (TRUE == version_compare($wp_version, '2.9.3', '<=') and TRUE == version_compare($wp_version, '2.4', '>')) {
                 switch ($taxonomy) {
                     default:
                     case 'post_tag':
                         $data['podcastFeedURL'] = get_tag_feed_link($input->term_id);
                         break;
                     case 'category':
                         $data['podcastFeedURL'] = get_category_feed_link($input->term_id);
                         break;
                 }
             } else {
                 $data['podcastFeedURL'] = site_url() . '/?feed=rss2&cat=' . $input->term_id;
             }
         } else {
             $url_parts = parse_url($data['podcastFeedURL']);
             if (isset($url_parts['query'])) {
                 $output = '';
                 parse_str($url_parts['query'], $output);
                 if (TRUE === isset($output['cat']) and FALSE !== empty($output['cat'])) {
                     if (TRUE == version_compare($wp_version, '2.9.3', '>')) {
                         // since WP 3.0 the cat_ID isreplaced by tag_ID
                         $data['podcastFeedURL'] = get_term_feed_link($input->term_id, $taxonomy);
                     } elseif (TRUE == version_compare($wp_version, '2.9.3', '<=') and TRUE == version_compare($wp_version, '2.4', '>')) {
                         switch ($taxonomy) {
                             default:
                             case 'post_tag':
                                 $data['podcastFeedURL'] = get_tag_feed_link($input->term_id);
                                 break;
                             case 'category':
                                 $data['podcastFeedURL'] = get_category_feed_link($input->term_id);
                                 break;
                         }
                     } else {
                         $data['podcastFeedURL'] = site_url() . '/?feed=rss2&cat=' . $input->term_id;
                     }
                 }
             }
         }
         // some ids of category input fields have changed with WP 3.0
         $wp_version_parts = explode('.', $wp_version);
         if (is_array($wp_version_parts)) {
             $main_wp_version = $wp_version_parts[0];
         } else {
             $main_wp_version = 0;
         }
         echo '<div class="wrap">' . "\n";
         if (TRUE == version_compare($wp_version, '2.7', '>=')) {
             echo '<div id="podpress-icon" class="icon32"><br /></div>';
         }
         echo '	<h2>' . sprintf(__('podPress %1$s Casting', 'podpress'), $taxonomy_str) . '</h2>' . "\n";
         echo '	<label for="categoryCasting"><strong>' . sprintf(__('Enable %1$s Casting', 'podpress'), $taxonomy_str) . '</strong></label>  <a href="javascript:void(null);" onclick="javascript: podPressShowHideDiv(\'categoryCastingHelp\');">(?)</a>:';
         echo '	<input type="checkbox" name="categoryCasting" id="categoryCasting" ';
         if ($data['categoryCasting'] == 'true') {
             echo 'checked="checked"';
         }
         echo ' onclick="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');"/>' . "\n";
         echo '	<div id="categoryCastingHelp" style="display: none;">' . "\n";
         echo '		' . __('This feature is for cases in which you want to host more than one podcast in one blog or if you want to have different podcast feeds with different media files of certain file types per feed (e.g a feed which contains only .mp3 files).<br />Basically this feature gives you the opportunity to modify some of the feed elements and set them to other then as the general value from the Feed/iTunes Settings of podPress.<br/>For instance: If you organize your audio episodes in one category and the video episodes in a different category then you can modify the feed content describing values like the title or the description in the form below. This your category feeds will be more distinguishable from another.', 'podpress') . '<br />' . "\n";
         echo '	</div>' . "\n";
         echo '  <div class="wrap" id="iTunesSpecificSettings" style="display: none; border: 0;">' . "\n";
         podPress_DirectoriesPreview('edit_category_form');
         echo '		<fieldset class="options">' . "\n";
         echo '		<legend>' . sprintf(__('%1$s Feed Options', 'podpress'), $taxonomy_str) . '</legend>' . "\n";
         echo '		<h3>' . __('iTunes Settings', 'podpress') . '</h3>' . "\n";
         echo '		<table class="podpress_feed_gensettings">' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesSubtitleChoice">' . __('iTunes:Subtitle', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesSubtitleChoice" name="iTunesSubtitleChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['iTunesSubtitleChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . '</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['iTunesSubtitleChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="iTunesSubtitleWrapper" style="display: none;">' . "\n";
         echo '						<textarea name="iTunesSubtitle" class="podpress_wide_text_field" rows="2" cols="40">' . stripslashes($data['iTunesSubtitle']) . '</textarea>' . "\n";
         echo '					</div>' . "\n";
         echo '					<div id="iTunesSubtitleHelp">' . "\n";
         echo '						' . __('A few words which describe the feed title a little bit more (max. 255 characters).', 'podpress') . ' ' . __('By default this is taken from the default iTunes:subtitle.', 'podpress') . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesSummaryChoice">' . __('iTunes:Summary', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesSummaryChoice" name="iTunesSummaryChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['iTunesSummaryChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . '</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['iTunesSummaryChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<input type="hidden" id="global_iTunesSummary" value="' . attribute_escape(stripslashes($this->settings['iTunes']['summary'])) . '" />' . "\n";
         echo '					<div id="iTunesSummaryWrapper" style="display: none;">' . "\n";
         echo '						<textarea name="iTunesSummary" id="iTunesSummary" class="podpress_wide_text_field" rows="6" cols="40" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . stripslashes($data['iTunesSummary']) . '</textarea>' . "\n";
         echo '					</div>' . "\n";
         echo '					<div id="iTunesSummaryHelp">' . "\n";
         echo '						' . __('The description of the podcast.', 'podpress') . ' ' . __('By default this is taken from the default iTunes:Summary or the default description.', 'podpress') . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesImageChoice">' . __('iTunes:Image', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					' . __('The iTunes image should be a square image with <a href="http://www.apple.com/itunes/podcasts/specs.html#image" target="_blank">at least 1400 x 1400 pixels</a> as Apple writes in "<a href="http://www.apple.com/itunes/podcasts/specs.html" target="_blank">Making a Podcast</a>" of their own Podcasting Resources. iTunes supports JPEG and PNG images (the file name extensions should ".jpg" or ".png").', 'podpress') . "\n";
         echo '					<br/>';
         echo '					<select id="iTunesImageChoice" name="iTunesImageChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['iTunesImageChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . '</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['iTunesImageChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="iTunesImageWrapper" style="display: none;">' . "\n";
         echo '						<br/>';
         echo '						<input id="iTunesImage" type="text" name="iTunesImage" value="' . $data['iTunesImage'] . '" class="podpress_wide_text_field" size="40" onchange="podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');"/>' . "\n";
         echo '						<input id="global_iTunesImage" type="hidden" value="' . $this->settings['iTunes']['image'] . '"/>' . "\n";
         echo '					</div>' . "\n";
         echo '					<br/>';
         echo '					<img id="itunes_image_display" style="width:300px; height:300px;" alt="' . __('Podcast Image - Big (If you can not see an image then the URL is wrong.)', 'podpress') . '" src="" /><br />' . "\n";
         echo '					<em>' . __('(This image is only a preview which is limited to 300 x 300 pixels.) ', 'podpress') . '</em>';
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesAuthorChoice">' . __('iTunes:Author/Owner', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesAuthorChoice" name="iTunesAuthorChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['iTunesAuthorChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . podPress_stringLimiter(ucfirst(stripslashes($this->settings['iTunes']['author'])), 40) . ')</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['iTunesAuthorChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="iTunesAuthorWrapper" style="display: none;">' . "\n";
         echo '						<input type="text" name="iTunesAuthor" class="podpress_wide_text_field" size="40" id="iTunesAuthor" value="' . attribute_escape(stripslashes($data['iTunesAuthor'])) . '" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');"/>';
         echo '						<input type="hidden" id="global_iTunesAuthor" value="' . attribute_escape(stripslashes($this->settings['iTunes']['author'])) . '" />' . "\n";
         echo '					</div>' . "\n";
         echo '					<div id="iTunesAuthorHelp">' . "\n";
         echo '						' . __('Used if this Author is different than the feeds author.', 'podpress') . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			<tr>' . "\n";
         echo '			</tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesAuthorEmailChoice">' . __('Owner E-mail address', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesAuthorEmailChoice" name="iTunesAuthorEmailChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['iTunesAuthorEmailChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . podPress_stringLimiter(ucfirst(stripslashes(get_option('admin_email'))), 40) . ')</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['iTunesAuthorEmailChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="iTunesAuthorEmailWrapper" style="display: none;">' . "\n";
         echo '						<input type="text" name="iTunesAuthorEmail" class="podpress_wide_text_field" size="40" id="iTunesAuthorEmail" value="' . attribute_escape(stripslashes($data['iTunesAuthorEmail'])) . '" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');"/>';
         echo '						<input type="hidden" id="global_iTunesAuthorEmail" value="' . attribute_escape(stripslashes(get_option('admin_email'))) . '" />' . "\n";
         echo '					</div>' . "\n";
         echo '					<div id="iTunesAuthorEmailHelp">' . "\n";
         echo '						' . __('Used if the owner of this category is different than the feeds owner.', 'podpress') . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesKeywordsChoice">' . __('iTunes:Keywords', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesKeywordsChoice" name="iTunesKeywordsChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['iTunesKeywordsChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . podPress_stringLimiter(stripslashes($this->settings['iTunes']['keywords']), 40) . ')</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['iTunesKeywordsChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="iTunesKeywordsWrapper">' . "\n";
         echo '						' . __('a list of max. 12 comma separated words', 'podpress') . '<br/><textarea name="iTunesKeywords" rows="4" cols="40">' . stripslashes($data['iTunesKeywords']) . '</textarea>' . "\n";
         echo '					</div>' . "\n";
         echo '					<div id="iTunesKeywordsHelp">' . "\n";
         echo '						' . __('Not visible in iTunes, but used for searches.', 'podpress') . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr> ' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesCategory_0">' . __('iTunes:Categories', 'podpress') . '</label>';
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesCategory_0" name="iTunesCategory[0]" onchange="podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<optgroup label="' . __('Select Primary', 'podpress') . '">' . "\n";
         if ('' == trim($this->settings['iTunes']['category'][0])) {
             $current_global = '[ ' . __('nothing', 'podpress') . ' ]';
         } else {
             $current_global = $this->settings['iTunes']['category'][0];
         }
         echo '						<option value="##Global##" ';
         if ($data['iTunesCategory'][0] == '##Global##' || empty($data['iTunesCategory'][0])) {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . $current_global . ')</option>' . "\n";
         if (empty($data['iTunesCategory'][0])) {
             podPress_itunesCategoryOptions('##Global##');
         } else {
             podPress_itunesCategoryOptions(stripslashes($data['iTunesCategory'][0]));
         }
         echo '						</optgroup>' . "\n";
         echo '					</select><br/>' . "\n";
         echo '					<input type="hidden" id="global_iTunesCategory" value="' . attribute_escape($this->settings['iTunes']['category'][0]) . '" />' . "\n";
         echo '					<select name="iTunesCategory[1]">' . "\n";
         echo '						<optgroup label="' . __('Select Second', 'podpress') . '">' . "\n";
         if ('' == trim($this->settings['iTunes']['category'][1])) {
             $current_global = '[ ' . __('nothing', 'podpress') . ' ]';
         } else {
             $current_global = $this->settings['iTunes']['category'][1];
         }
         echo '						<option value="##Global##" ';
         if ($data['iTunesCategory'][1] == '##Global##' || empty($data['iTunesCategory'][1])) {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . $current_global . ')</option>' . "\n";
         if (empty($data['iTunesCategory'][1])) {
             podPress_itunesCategoryOptions('##Global##');
         } else {
             podPress_itunesCategoryOptions(stripslashes($data['iTunesCategory'][1]));
         }
         echo '						</optgroup>' . "\n";
         echo '					</select><br/>' . "\n";
         echo '					<select name="iTunesCategory[2]">' . "\n";
         echo '						<optgroup label="' . __('Select Third', 'podpress') . '">' . "\n";
         if ('' == trim($this->settings['iTunes']['category'][2])) {
             $current_global = '[ ' . __('nothing', 'podpress') . ' ]';
         } else {
             $current_global = $this->settings['iTunes']['category'][2];
         }
         echo '						<option value="##Global##" ';
         if ($data['iTunesCategory'][2] == '##Global##' || empty($data['iTunesCategory'][2])) {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . $current_global . ')</option>' . "\n";
         if (empty($data['iTunesCategory'][2])) {
             podPress_itunesCategoryOptions('##Global##');
         } else {
             podPress_itunesCategoryOptions(stripslashes($data['iTunesCategory'][2]));
         }
         echo '						</optgroup>' . "\n";
         echo '					</select>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesExplicit">' . __('iTunes:Explicit', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesExplicit" name="iTunesExplicit" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="##Global##" ';
         if ($data['iTunesExplicit'] == '##Global##' || empty($data['iTunesExplicit'])) {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . $this->settings['iTunes']['explicit'] . ')</option>' . "\n";
         echo '						<option value="No" ';
         if ($data['iTunesExplicit'] == 'No') {
             echo 'selected="selected"';
         }
         echo '>' . __('No', 'podpress') . '</option>' . "\n";
         echo '						<option value="Yes" ';
         if ($data['iTunesExplicit'] == 'Yes') {
             echo 'selected="selected"';
         }
         echo '>' . __('Yes', 'podpress') . '</option>' . "\n";
         echo '						<option value="Clean" ';
         if ($data['iTunesExplicit'] == 'Clean') {
             echo 'selected="selected"';
         }
         echo '>' . __('Clean', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="iTunesExplicitHelp">' . "\n";
         echo '					' . __('Setting to indicate (in iTunes) whether or not your podcast contains explicit language or adult content', 'podpress') . "\n";
         echo '					<br/>' . __('"No" (default) - no indicator will show up', 'podpress') . "\n";
         echo '					<br/>' . __('"Yes" - an "EXPLICIT" parental advisory graphic will appear next to your podcast artwork or name in iTunes', 'podpress') . "\n";
         echo '					<br/>' . __('"Clean" - means that you are sure that no explicit language or adult content is included any of the episodes, and a "CLEAN" graphic will appear', 'podpress') . "\n";
         echo '					<p>' . __('You have also the possibility to adjust this option for each post or page with at least one podcast episode (in the post/page editor).', 'podpress') . '</p>' . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesBlock">' . __('iTunes:Block', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesBlock" name="iTunesBlock" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="##Global##" ';
         if ($data['iTunesBlock'] != '##Global##' || empty($data['itunesBlock'])) {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . $this->settings['iTunes']['block'] . ')</option>' . "\n";
         echo '						<option value="No" ';
         if ($data['iTunesBlock'] == 'No') {
             echo 'selected="selected"';
         }
         echo '>' . __('No', 'podpress') . '</option>' . "\n";
         echo '						<option value="Yes" ';
         if ($data['iTunesBlock'] == 'Yes') {
             echo 'selected="selected"';
         }
         echo '>' . __('Yes', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="itunesBlockHelp">' . "\n";
         echo '					' . __('Use this if you are no longer creating a podcast and you want it removed from the iTunes Store.', 'podpress') . "\n";
         echo '					<br/>' . __('"No" (default) - the podcast appears in the iTunes Podcast directory', 'podpress') . "\n";
         echo '					<br/>' . __('"Yes" - prevent the entire podcast from appearing in the iTunes Podcast directory', 'podpress') . "\n";
         echo '					<p>' . __('You can also use such an option for each of your podcast episodes (in the post/page editor).', 'podpress') . '</p>' . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr> ' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesFeedID">' . __('iTunes:FeedID', 'podpress') . '</label>';
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<input name="iTunesFeedID" id="iTunesFeedID" type="text" value="' . attribute_escape($data['iTunesFeedID']) . '" size="10" /> ' . __('(Only relevant for the podPress Feed Buttons widget)', 'podpress');
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr> ' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesNewFeedURL">' . __('iTunes:New-Feed-Url', 'podpress') . '</label>';
         echo '				</th>';
         echo '				<td>';
         echo '					<select name="iTunesNewFeedURL" id="iTunesNewFeedURL">' . "\n";
         echo '						<option value="##Global##" ';
         if ($data['iTunesNewFeedURL'] == '##Global##' || empty($data['iTunesNewFeedURL'])) {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . '</option>' . "\n";
         echo '						<option value="Disable" ';
         if ($data['iTunesNewFeedURL'] == 'Disable') {
             echo 'selected="selected"';
         }
         echo '>' . __('Disable', 'podpress') . '</option>' . "\n";
         echo '						<option value="Enable" ';
         if ($data['iTunesNewFeedURL'] == 'Enable') {
             echo 'selected="selected"';
         }
         echo '>' . __('Enable', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '				</td>';
         echo '				<td>';
         echo '					' . __('If you want to change the URL of your podcast feed which you have used in the iTunes Store then change the "Podcast Feed URL" and set this option to "Enable" until the iTunes Store recognizes the new URL. This may take several days. "Enable" will add the <code>&lt;itunes:new-feed-url&gt;</code> tag to the RSS feeds and set the "Podcast Feed URL" as the new URL. For further information about "<a href="http://www.apple.com/itunes/podcasts/specs.html#changing" title="iTunes Podcasting Resources: Changing Your Feed URL" target="_blank">Changing Your Feed URL</a>" read on in the <a href="http://www.apple.com/itunes/podcasts/specs.html" target="_blank" title="iTunes Podcasting Resources: Making a Podcast">iTunes Podcasting Resources</a>.', 'podpress') . "\n";
         echo '					<p><label for="podcastFeedURL"><strong>' . __('the new Feed URL', 'podpress') . '</strong></label>';
         echo '					<br/>';
         echo '					<input type="text" id="podcastFeedURL" name="podcastFeedURL" class="podpress_wide_text_field" size="40" value="' . attribute_escape($data['podcastFeedURL']) . '" /><br />' . __('The URL of your Podcast Feed. If you want to register your podcast at the iTunes Store or if your podcast is already listed there then this input field should contain the same URL as in the iTunes Store settings. If you want change the URL at the iTunes Store then please read first the help text of the iTunes:New-Feed-Url option.', 'podpress');
         echo '					<br /><input type="button" value="' . __('Validate your Feed', 'podpress') . '" onclick="javascript: if(document.getElementById(\'podcastFeedURL\').value != \'\') { window.open(\'http://www.feedvalidator.org/check.cgi?url=\'+document.getElementById(\'podcastFeedURL\').value); }"/>' . "\n";
         echo '				</p></td>' . "\n";
         echo '			</tr>' . "\n";
         echo '		</table>' . "\n";
         echo '		<h3>' . __('General Feed Settings', 'podpress') . '</h3>' . "\n";
         echo '		<table class="podpress_feed_gensettings">' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="blognameChoice">' . __('Podcast title / Feed title', 'podpress') . '</label>';
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="blognameChoice" name="blognameChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Append" ';
         if ($data['blognameChoice'] == 'Append' || empty($data['blognameChoice'])) {
             echo 'selected="selected"';
         }
         echo '>' . sprintf(__('Use the Site Title and append the name of the %1$s', 'podpress'), $taxonomy_str) . '</option>' . "\n";
         echo '						<option value="Global" ';
         if ($data['blognameChoice'] == 'Global') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use the Site Title', 'podpress') . '</option>' . "\n";
         echo '						<option value="CategoryName" ';
         if ($data['blognameChoice'] == 'CategoryName') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use the name of the category', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<input type="hidden" id="global_blogname" value="' . attribute_escape(stripslashes(get_option('blogname'))) . '" /></td>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="blogdescriptionChoice">' . __('Description (Tagline)', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="blogdescriptionChoice" name="blogdescriptionChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['blogdescriptionChoice'] != 'CategoryDescription') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . '</option>' . "\n";
         echo '						<option value="CategoryDescription" ';
         if ($data['blogdescriptionChoice'] == 'CategoryDescription') {
             echo 'selected="selected"';
         }
         echo '>' . sprintf(__('Use %1$s Description', 'podpress'), $taxonomy_str) . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<input type="hidden" id="global_blogdescription" value="' . attribute_escape(stripslashes(get_option('blogdescription'))) . '" />' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="rss_imageChoice">' . __('Blog/RSS Image (144 x 144 pixels)', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="rss_imageChoice" name="rss_imageChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['rss_imageChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . '</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['rss_imageChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="rss_imageWrapper" style="display: none;">' . "\n";
         echo '						<br/>';
         echo '						<input id="rss_image" type="text" name="rss_image" value="' . $data['rss_image'] . '" class="podpress_wide_text_field" size="40" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');"/>' . "\n";
         echo '						<input id="global_rss_image" type="hidden" value="' . get_option('rss_image') . '"/>' . "\n";
         echo '					</div>' . "\n";
         echo '					<br/>';
         echo '					<img id="rss_image_Display" style="width:144px; height:144px;" alt="' . __('Podcast Image - Small (If you can not see an image then the URL is wrong.)', 'podpress') . '" src="" />' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="rss_language">' . __('Language', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         $langs = podPress_itunesLanguageArray();
         echo '					<select id="rss_language" name="rss_language" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<optgroup label="' . __('Select Language', 'podpress') . '">' . "\n";
         echo '						<option value="##Global##" ';
         if ($data['rss_language'] == '##Global##' || empty($data['rss_language'])) {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' - ' . $langs[get_option('rss_language')] . ' [' . get_option('rss_language') . ']</option>' . "\n";
         podPress_itunesLanguageOptions($data['rss_language']);
         echo '						</optgroup>' . "\n";
         echo '					</select>' . "\n";
         echo '					<input type="hidden" id="global_rss_language" value="' . $langs[get_option('rss_language')] . '[' . attribute_escape(get_option('rss_language')) . ']" /></td>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '		</table>' . "\n";
         echo '		<h3>' . __('Further Feed Settings', 'podpress') . '</h3>' . "\n";
         echo '		<table class="podpress_feed_gensettings">' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>' . "\n";
         echo '					<label for="rss_copyrightChoice">' . __('Feed Copyright / license name', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="rss_copyrightChoice" name="rss_copyrightChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['rss_copyrightChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . podPress_stringLimiter(ucfirst(stripslashes($this->settings['rss_copyright'])), 40) . ')</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['rss_copyrightChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="rss_copyrightWrapper" style="display: none;">' . "\n";
         echo '						<input type="text" name="rss_copyright" class="podpress_wide_text_field" size="40" id="rss_copyright" value="' . attribute_escape(stripslashes($data['rss_copyright'])) . '" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');"/>';
         echo '					</div>' . "\n";
         echo '					<input type="hidden" id="global_rss_copyright" value="' . attribute_escape(stripslashes($this->settings['rss_copyright'])) . '" />' . "\n";
         echo '					<div id="rss_copyrightHelp">' . "\n";
         echo '						' . __('Enter the copyright string or license name. For example: Copyright &#169 by Jon Doe, 2009 OR <a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" target="_blank">CreativeCommons Attribution-Noncommercial-Share Alike 2.5</a>', 'podpress') . "\n";
         echo '						<p>' . "\n";
         echo '						' . __('Used if this copyright phrase should be different than the global copyright phrase.', 'podpress') . "\n";
         echo '						</p>' . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>' . "\n";
         echo '					<label for="rss_license_urlChoice">' . __('URL to the full Copyright / license text', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="rss_license_urlChoice" name="rss_license_urlChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['rss_license_urlChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . podPress_stringLimiter(ucfirst(stripslashes($this->settings['rss_license_url'])), 40) . ')</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['rss_license_urlChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="rss_license_urlWrapper" style="display: none;">' . "\n";
         echo '						<input name="rss_license_url" type="text" id="rss_license_url" class="podpress_wide_text_field" value="' . attribute_escape($data['rss_license_url']) . '" size="65%" />' . "\n";
         echo '					</div>' . "\n";
         echo '					<input type="hidden" id="global_rss_license_url" value="' . attribute_escape($this->settings['rss_license_url']) . '" />' . "\n";
         echo '					<div id="rss_license_urlHelp">' . "\n";
         echo '						' . __('If you use a special license like a <a href="http://creativecommons.org/licenses" target="_blank" title="Creative Commons">Creative Commons</a> License for your news feeds then enter the complete URL (e.g. <a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" target="_blank">http://creativecommons.org/licenses/by-nc-sa/2.5/</a>) to the full text of this particular license here.', 'podpress') . "\n";
         echo '						<p>' . __('Used if this license URL should be different than the global license URL.', 'podpress') . '</p>' . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         $filetypes = podPress_filetypes();
         $selected_types = $data['FileTypes'];
         if (FALSE === is_array($data['FileTypes'])) {
             $selected_types = array();
         }
         echo '				<th>';
         echo '				' . __('inlude only files of this(these) type(s)', 'podpress');
         echo '				</th>' . "\n";
         echo '				<td>';
         echo '					<select id="filenameextensionfilter" name="FileTypes[]" size="5" multiple="multiple" style="height:15em;">' . "\n";
         echo '					<optgroup label="' . attribute_escape(__('Select file types', 'podpress')) . '">' . "\n";
         foreach ($filetypes as $key => $value) {
             if (TRUE == in_array($key, $selected_types)) {
                 $selected = ' selected="selected"';
             } else {
                 $selected = '';
             }
             if ($key !== 'audio_mp4') {
                 echo '						<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
             }
         }
         echo '					</optgroup>' . "\n";
         echo '					</select>' . "\n";
         echo '				</td>' . "\n";
         echo '				<td>';
         echo '					' . __('You can select one or more media file types and limit by this choice the number of posts which will appear in the this Feed. For instance: if you select MP4 Video then this Feed will only contain posts (of this category) with MP4 files. If a post has also files of other types then only the files of the selected type will be attached in this feed. (This filter bypasses the "Included in:" selection.)', 'podpress') . '</p><p>' . __('Hold the key [SHIFT] or [CTRL] and use the left mouse button to select more than one value.<br />Hold [CTRL] and use the left mouse button to deselect values.', 'podpress');
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '				<label for="show_only_podPress_podcasts">' . __('Include only posts with podPress attachments in this Feed', 'podpress') . '</label>' . "\n";
         echo '				</th>' . "\n";
         echo '				<td>';
         if (TRUE == isset($data['show_only_podPress_podcasts']) and FALSE === $data['show_only_podPress_podcasts']) {
             echo '					<input type="checkbox" name="show_only_podPress_podcasts" id="show_only_podPress_podcasts" value="yes" />' . "\n";
         } else {
             echo '					<input type="checkbox" name="show_only_podPress_podcasts" id="show_only_podPress_podcasts" value="yes" checked="checked" />' . "\n";
         }
         echo '				</td>' . "\n";
         echo '				<td>';
         echo '					' . __('works only while the File Type Filter is not in use', 'podpress');
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '		</table>' . "\n";
         echo '		</fieldset>' . "\n";
         echo '	</div>' . "\n";
         echo '<script type="text/javascript">podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\'); </script>';
         echo '</div>' . "\n";
     }
 }
Example #25
0
 /**
  * Flushes post cache
  *
  * @param integer $post_id
  * @return boolean
  */
 function flush_post($post_id = null)
 {
     if (!$post_id) {
         $post_id = $this->_detect_post_id();
     }
     if ($post_id) {
         $uris = array();
         $domain_url = w3_get_domain_url();
         $feeds = $this->_config->get_array('pgcache.purge.feed.types');
         if ($this->_config->get_boolean('pgcache.purge.terms') || $this->_config->get_boolean('pgcache.purge.feed.terms')) {
             $taxonomies = get_post_taxonomies($post_id);
             $terms = nxt_get_post_terms($post_id, $taxonomies);
         }
         switch (true) {
             case $this->_config->get_boolean('pgcache.purge.author'):
             case $this->_config->get_boolean('pgcache.purge.archive.daily'):
             case $this->_config->get_boolean('pgcache.purge.archive.monthly'):
             case $this->_config->get_boolean('pgcache.purge.archive.yearly'):
             case $this->_config->get_boolean('pgcache.purge.feed.author'):
                 $post = get_post($post_id);
         }
         /**
          * Home URL
          */
         if ($this->_config->get_boolean('pgcache.purge.home')) {
             $home_path = w3_get_home_path();
             $site_path = w3_get_site_path();
             $uris[] = $home_path;
             if ($site_path != $home_path) {
                 $uris[] = $site_path;
             }
         }
         /**
          * Post URL
          */
         if ($this->_config->get_boolean('pgcache.purge.post')) {
             $post_link = post_permalink($post_id);
             $post_uri = str_replace($domain_url, '', $post_link);
             $uris[] = $post_uri;
         }
         /**
          * Post comments URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.comments') && function_exists('get_comments_pagenum_link')) {
             $comments_number = get_comments_number($post_id);
             $comments_per_page = get_option('comments_per_page');
             $comments_pages_number = @ceil($comments_number / $comments_per_page);
             for ($pagenum = 1; $pagenum <= $comments_pages_number; $pagenum++) {
                 $comments_pagenum_link = $this->_get_comments_pagenum_link($post_id, $pagenum);
                 $comments_pagenum_uri = str_replace($domain_url, '', $comments_pagenum_link);
                 $uris[] = $comments_pagenum_uri;
             }
         }
         /**
          * Post author URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.author') && $post) {
             $posts_number = count_user_posts($post->post_author);
             $posts_per_page = get_option('posts_per_page');
             $posts_pages_number = @ceil($posts_number / $posts_per_page);
             $author_link = get_author_link(false, $post->post_author);
             $author_uri = str_replace($domain_url, '', $author_link);
             for ($pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++) {
                 $author_pagenum_link = $this->_get_pagenum_link($author_uri, $pagenum);
                 $author_pagenum_uri = str_replace($domain_url, '', $author_pagenum_link);
                 $uris[] = $author_pagenum_uri;
             }
         }
         /**
          * Post terms URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.terms')) {
             $posts_per_page = get_option('posts_per_page');
             foreach ($terms as $term) {
                 $term_link = get_term_link($term, $term->taxonomy);
                 $term_uri = str_replace($domain_url, '', $term_link);
                 $posts_pages_number = @ceil($term->count / $posts_per_page);
                 for ($pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++) {
                     $term_pagenum_link = $this->_get_pagenum_link($term_uri, $pagenum);
                     $term_pagenum_uri = str_replace($domain_url, '', $term_pagenum_link);
                     $uris[] = $term_pagenum_uri;
                 }
             }
         }
         /**
          * Daily archive URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.archive.daily') && $post) {
             $post_date = strtotime($post->post_date);
             $post_year = gmdate('Y', $post_date);
             $post_month = gmdate('m', $post_date);
             $post_day = gmdate('d', $post_date);
             $posts_per_page = get_option('posts_per_page');
             $posts_number = $this->_get_archive_posts_count($post_year, $post_month, $post_day);
             $posts_pages_number = @ceil($posts_number / $posts_per_page);
             $day_link = get_day_link($post_year, $post_month, $post_day);
             $day_uri = str_replace($domain_url, '', $day_link);
             for ($pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++) {
                 $day_pagenum_link = $this->_get_pagenum_link($day_uri, $pagenum);
                 $day_pagenum_uri = str_replace($domain_url, '', $day_pagenum_link);
                 $uris[] = $day_pagenum_uri;
             }
         }
         /**
          * Monthly archive URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.archive.monthly') && $post) {
             $post_date = strtotime($post->post_date);
             $post_year = gmdate('Y', $post_date);
             $post_month = gmdate('m', $post_date);
             $posts_per_page = get_option('posts_per_page');
             $posts_number = $this->_get_archive_posts_count($post_year, $post_month);
             $posts_pages_number = @ceil($posts_number / $posts_per_page);
             $month_link = get_month_link($post_year, $post_month);
             $month_uri = str_replace($domain_url, '', $month_link);
             for ($pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++) {
                 $month_pagenum_link = $this->_get_pagenum_link($month_uri, $pagenum);
                 $month_pagenum_uri = str_replace($domain_url, '', $month_pagenum_link);
                 $uris[] = $month_pagenum_uri;
             }
         }
         /**
          * Yearly archive URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.archive.yearly') && $post) {
             $post_date = strtotime($post->post_date);
             $post_year = gmdate('Y', $post_date);
             $posts_per_page = get_option('posts_per_page');
             $posts_number = $this->_get_archive_posts_count($post_year);
             $posts_pages_number = @ceil($posts_number / $posts_per_page);
             $year_link = get_year_link($post_year);
             $year_uri = str_replace($domain_url, '', $year_link);
             for ($pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++) {
                 $year_pagenum_link = $this->_get_pagenum_link($year_uri, $pagenum);
                 $year_pagenum_uri = str_replace($domain_url, '', $year_pagenum_link);
                 $uris[] = $year_pagenum_uri;
             }
         }
         /**
          * Feed URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.feed.blog')) {
             foreach ($feeds as $feed) {
                 $feed_link = get_feed_link($feed);
                 $feed_uri = str_replace($domain_url, '', $feed_link);
                 $uris[] = $feed_uri;
             }
         }
         if ($this->_config->get_boolean('pgcache.purge.feed.comments')) {
             foreach ($feeds as $feed) {
                 $post_comments_feed_link = get_post_comments_feed_link($post_id, $feed);
                 $post_comments_feed_uri = str_replace($domain_url, '', $post_comments_feed_link);
                 $uris[] = $post_comments_feed_uri;
             }
         }
         if ($this->_config->get_boolean('pgcache.purge.feed.author') && $post) {
             foreach ($feeds as $feed) {
                 $author_feed_link = get_author_feed_link($post->post_author, $feed);
                 $author_feed_uri = str_replace($domain_url, '', $author_feed_link);
                 $uris[] = $author_feed_uri;
             }
         }
         if ($this->_config->get_boolean('pgcache.purge.feed.terms')) {
             foreach ($terms as $term) {
                 foreach ($feeds as $feed) {
                     $term_feed_link = get_term_feed_link($term->term_id, $term->taxonomy, $feed);
                     $term_feed_uri = str_replace($domain_url, '', $term_feed_link);
                     $uris[] = $term_feed_uri;
                 }
             }
         }
         /**
          * Flush cache
          */
         if (count($uris)) {
             $cache =& $this->_get_cache();
             $mobile_groups = $this->_get_mobile_groups();
             $referrer_groups = $this->_get_referrer_groups();
             $encryptions = $this->_get_encryptions();
             $compressions = $this->_get_compressions();
             foreach ($uris as $uri) {
                 foreach ($mobile_groups as $mobile_group) {
                     foreach ($referrer_groups as $referrer_group) {
                         foreach ($encryptions as $encryption) {
                             foreach ($compressions as $compression) {
                                 $page_key = $this->_get_page_key($uri, $mobile_group, $referrer_group, $encryption, $compression);
                                 $cache->delete($page_key);
                             }
                         }
                     }
                 }
             }
             /**
              * Purge varnish servers
              */
             if ($this->_config->get_boolean('varnish.enabled')) {
                 $varnish =& w3_instance('W3_Varnish');
                 foreach ($uris as $uri) {
                     $varnish->purge($uri);
                 }
             }
         }
         return true;
     }
     return false;
 }
Example #26
0
		
			<h1 class="page-title">
				<?php 
printf(__ti('Tag Archives: %s'), '<span>' . single_tag_title('', false) . '</span>');
?>
			</h1>
			
			<?php 
if (tie_get_option('tag_rss')) {
    $tag_id = get_query_var('tag_id');
    ?>
			<a class="rss-cat-icon tooltip" title="<?php 
    _eti('Feed Subscription');
    ?>
"  href="<?php 
    echo get_term_feed_link($tag_id, 'post_tag', "rss2");
    ?>
"><i class="fa fa-rss"></i></a>
			<?php 
}
?>
			
			<div class="stripe-line"></div>
			
			<?php 
if (tie_get_option('tag_desc')) {
    $tag_description = tag_description();
    if (!empty($tag_description)) {
        echo '<div class="clear"></div><div class="archive-meta">' . $tag_description . '</div>';
    }
}
 function woo_archive_title($before = '', $after = '', $echo = true)
 {
     global $wp_query;
     if (is_category() || is_tag() || is_tax()) {
         $taxonomy_obj = $wp_query->get_queried_object();
         $term_id = $taxonomy_obj->term_id;
         $taxonomy_short_name = $taxonomy_obj->taxonomy;
         $taxonomy_raw_obj = get_taxonomy($taxonomy_short_name);
     }
     // End IF Statement
     $title = '';
     $delimiter = ' | ';
     $date_format = get_option('date_format');
     // Category Archive
     if (is_category()) {
         $title = '<span class="fl cat">' . __('Archive', 'woothemes') . $delimiter . single_cat_title('', false) . '</span> <span class="fr catrss">';
         $cat_obj = $wp_query->get_queried_object();
         $cat_id = $cat_obj->cat_ID;
         $title .= '<a href="' . get_term_feed_link($term_id, $taxonomy_short_name, '') . '" class="icon-rss icon-large" ></a></span>';
         $has_title = true;
     }
     // Day Archive
     if (is_day()) {
         $title = __('Archive', 'woothemes') . $delimiter . get_the_time($date_format);
     }
     // Month Archive
     if (is_month()) {
         $date_format = apply_filters('woo_archive_title_date_format', 'F, Y');
         $title = __('Archive', 'woothemes') . $delimiter . get_the_time($date_format);
     }
     // Year Archive
     if (is_year()) {
         $date_format = apply_filters('woo_archive_title_date_format', 'Y');
         $title = __('Archive', 'woothemes') . $delimiter . get_the_time($date_format);
     }
     // Author Archive
     if (is_author()) {
         $title = __('Author Archive', 'woothemes') . $delimiter . get_the_author_meta('display_name', get_query_var('author'));
     }
     // Tag Archive
     if (is_tag()) {
         $title = __('Tag Archives', 'woothemes') . $delimiter . single_tag_title('', false);
     }
     // Post Type Archive
     if (function_exists('is_post_type_archive') && is_post_type_archive()) {
         /* Get the post type object. */
         $post_type_object = get_post_type_object(get_query_var('post_type'));
         $title = $post_type_object->labels->name . ' ' . __('Archive', 'woothemes');
     }
     // Post Format Archive
     if (get_query_var('taxonomy') == 'post_format') {
         $post_format = str_replace('post-format-', '', get_query_var('post_format'));
         $title = get_post_format_string($post_format) . ' ' . __(' Archives', 'woothemes');
     }
     // General Taxonomy Archive
     if (is_tax()) {
         $title = sprintf(__('%1$s Archives: %2$s', 'woothemes'), $taxonomy_raw_obj->labels->name, $taxonomy_obj->name);
     }
     if (strlen($title) == 0) {
         return;
     }
     $title = $before . $title . $after;
     // Allow for external filters to manipulate the title value.
     $title = apply_filters('woo_archive_title', $title, $before, $after);
     if ($echo) {
         echo $title;
     } else {
         return $title;
     }
 }
			</div>

			<!-- left block -->
			<div class="content_left">

				<?php 
$term = get_queried_object();
?>

				<div class="shadowblock_out">

					<div class="shadowblock">

						<div id="catrss"><a href="<?php 
echo get_term_feed_link($term->term_id, $taxonomy);
?>
" title="<?php 
printf(__('%s RSS Feed', APP_TD), $term->name);
?>
"><?php 
printf(__('%s RSS Feed', APP_TD), $term->name);
?>
</a></div>
						<h2><?php 
_e('Listings tagged with', APP_TD);
?>
 '<?php 
echo $term->name;
?>
' (<?php 
Example #29
0
/**
 * Retrieve permalink for feed of tag.
 *
 * @since 2.3.0
 *
 * @param int    $tag_id Tag ID.
 * @param string $feed   Optional. Feed type.
 * @return string The feed permalink for the given tag.
 */
function get_tag_feed_link($tag_id, $feed = '')
{
    return get_term_feed_link($tag_id, 'post_tag', $feed);
}
Example #30
0
?>
</div>

			<!-- left block -->
			<div class="content_left">

				<?php 
$term = get_queried_object();
?>

				<div class="shadowblock_out">

					<div class="shadowblock">

						<div id="catrss" class="catrss"><a class="dashicons-before catrss" href="<?php 
echo esc_url(get_term_feed_link($term->term_id, $taxonomy));
?>
" title="<?php 
echo esc_url(sprintf(__('%s RSS Feed', APP_TD), $term->name));
?>
"></a></div>
						<h1 class="single dotted"><?php 
_e('Listings tagged with', APP_TD);
?>
 '<?php 
echo $term->name;
?>
' (<?php 
echo $wp_query->found_posts;
?>
)</h1>