本文整理匯總了PHP中C::get_nsfw方法的典型用法代碼示例。如果您正苦於以下問題:PHP C::get_nsfw方法的具體用法?PHP C::get_nsfw怎麽用?PHP C::get_nsfw使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類C
的用法示例。
在下文中一共展示了C::get_nsfw方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_the_excerpt
<?php
if (get_the_excerpt() != '') {
?>
<div class="entry-meta">
<?php
echo get_the_excerpt();
?>
</div>
<?php
}
?>
<!-- nsfw? -->
<?php
if (C::get_nsfw() != '') {
?>
<div class="episode-nsfw">
<p>This episode has been flagged as <span class="nsfw" title="Not Safe For Work">NSFW</span>. Please be advised.</p>
</div>
<?php
}
?>
<!-- content -->
<?php
the_content();
?>
<div class="edit"><?php
edit_post_link('Edit Episode');
示例2: convergence_feed_description_filter
/**
* Filter. Adds a call to action to the end of all Feed items.
* @param type $content
* @return type
*/
function convergence_feed_description_filter($content)
{
global $wp_query;
$post_id = $wp_query->post->ID;
$excerpt = get_the_excerpt($post_id);
$nsfw = "";
if (C::get_nsfw() != "") {
$nsfw = "<p>This episode has been flagged as <strong>NSFW</strong>. Please be advised.</p><br /><br />";
}
$fringe = C::get_related_fringe_url();
if ($fringe != "") {
$fringe = '<p>This episode has a related <a href="' . $fringe . '">Fringe</a> episode. You should listen!</a></p>';
}
$content = strip_tags($excerpt) . "<br /><br />" . $nsfw . $content . $fringe;
$extra = '<br /><br />Listen to more at <a href=' . get_bloginfo('siteurl') . '>The-Nexus.tv</a> and follow us on <a href="http://twitter.com/thenexustv">Twitter</a>.';
$content = $content . $extra;
return $content;
}