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


PHP wpgrade::filter_content方法代碼示例

本文整理匯總了PHP中wpgrade::filter_content方法的典型用法代碼示例。如果您正苦於以下問題:PHP wpgrade::filter_content方法的具體用法?PHP wpgrade::filter_content怎麽用?PHP wpgrade::filter_content使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在wpgrade的用法示例。


在下文中一共展示了wpgrade::filter_content方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: esc_html

//we need to mess with the subtitle a little bit - because it deserves it
//we need to wrap the first subtitle letter in a span so we can control it - height wise
if (!empty($subtitle)) {
    $subtitle = esc_html($subtitle);
    $first_char = mb_substr($subtitle, 0, 1);
    $subtitle = '<span class="first-letter">' . $first_char . '</span>' . mb_substr($subtitle, 1);
}
$title = __(get_post_meta(wpgrade::lang_page_id(get_the_ID()), wpgrade::prefix() . 'page_cover_title', true));
if (empty($title)) {
    //use the page title if empty
    $title = get_the_title();
}
$description = __(get_post_meta(wpgrade::lang_page_id(get_the_ID()), wpgrade::prefix() . 'page_cover_description', true));
$pin_type = get_post_meta(wpgrade::lang_page_id(get_the_ID()), wpgrade::prefix() . 'page_gmap_pin_type', true);
//filter the content with some limitations to avoid having plugins doing nasty things to it
$description = wpgrade::filter_content($description, 'default');
if (get_page_template_slug(get_the_ID()) == 'page-templates/contact.php') {
    if (empty($pin_type)) {
        $pin_type = 'single';
    }
} else {
    $pin_type = '';
}
/* FIRST TEST FOR CONTACT PAGE TEMPLATE */
if ($pin_type == 'single') {
    //get the Google Maps URL to test if empty
    $gmap_url = get_post_meta(wpgrade::lang_page_id(get_the_ID()), wpgrade::prefix() . 'gmap_url', true);
    if (!empty($gmap_url)) {
        //set the global so everybody knows that we are in dire need of the Google Maps API
        $is_gmap = true;
        $gmap_custom_style = get_post_meta(wpgrade::lang_page_id(get_the_ID()), wpgrade::prefix() . 'gmap_custom_style', true);
開發者ID:andreilupu,項目名稱:jassyro-rosa-child-theme,代碼行數:31,代碼來源:header.php


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