當前位置: 首頁>>代碼示例>>PHP>>正文


PHP C::get_nsfw方法代碼示例

本文整理匯總了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');
開發者ID:ryanmr,項目名稱:convergence-theme,代碼行數:30,代碼來源:single-episode.php

示例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;
}
開發者ID:ryanmr,項目名稱:convergence-theme,代碼行數:23,代碼來源:functions.php


注:本文中的C::get_nsfw方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。