当前位置: 首页>>代码示例>>PHP>>正文


PHP cfct_content函数代码示例

本文整理汇总了PHP中cfct_content函数的典型用法代码示例。如果您正苦于以下问题:PHP cfct_content函数的具体用法?PHP cfct_content怎么用?PHP cfct_content使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了cfct_content函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: cfct_ajax_post_content

function cfct_ajax_post_content($post_id)
{
    global $post, $posts, $wp_query, $wp;
    $posts = get_posts('include=' . $post_id);
    $post = $posts[0];
    if (is_null($post)) {
        $posts = get_pages('include=' . $post_id);
        $post = $posts[0];
    }
    if (is_null($post)) {
        $posts = get_posts('post_status=private&include=' . $post_id);
        $post = $posts[0];
        if ($post) {
            $user = wp_get_current_user();
            if (!$user->ID || $user->ID != $post->post_author) {
                $post = null;
            }
        }
    }
    if (!$post) {
        die('');
    }
    $wp_query->in_the_loop = true;
    setup_postdata($post);
    remove_filter('the_content', 'st_add_widget');
    $wp->send_headers();
    cfct_content();
    echo '<div class="close" id="post_close_' . $post_id . '"><a href="#">' . __('Close', 'carrington') . '</a></div>';
}
开发者ID:rascoop,项目名称:carrington,代码行数:29,代码来源:ajax-load.php

示例2: cfct_ajax_post_content

function cfct_ajax_post_content($post_id)
{
    global $posts, $post;
    $posts = get_posts('include=' . $post_id);
    $post = $posts[0];
    setup_postdata($post);
    cfct_content();
}
开发者ID:rascoop,项目名称:carrington,代码行数:8,代码来源:ajax-load.php

示例3: cfct_ajax_post_content

function cfct_ajax_post_content($post_id)
{
    global $posts, $post;
    $posts = get_posts('include=' . $post_id);
    $post = $posts[0];
    if (is_null($post)) {
        $posts = get_pages('include=' . $post_id);
        $post = $posts[0];
    }
    setup_postdata($post);
    remove_filter('the_content', 'st_add_widget');
    cfct_content();
}
开发者ID:rascoop,项目名称:carrington,代码行数:13,代码来源:ajax-load.php

示例4: cfct_ajax_post_content

/**
 * Add markup to a post for AJAX display of post content
 * 
 * @return The markup for a close link
 * 
**/
function cfct_ajax_post_content($post_id)
{
    global $post, $posts, $wp_query, $wp;
    $post = get_post($post_id);
    // If the post wasn't found, or is not published or private, we're not interested.
    if (!is_object($post) || !in_array($post->post_status, array('publish', 'private'))) {
        die;
    }
    // If the post is private, make sure the user is allowed to see it before we show it.
    if ($post->post_status == 'private') {
        $user = wp_get_current_user();
        if (!$user->ID || !($user->ID == $post->post_author || current_user_can('editor') || current_user_can('administrator'))) {
            die;
        }
    }
    $wp_query->in_the_loop = true;
    setup_postdata($post);
    remove_filter('the_content', 'st_add_widget');
    $wp->send_headers();
    cfct_content();
    echo apply_filters('cfct_ajax_post_content_close', '<div class="close" id="post_close_' . $post_id . '"><a href="#">' . __('Close', 'carrington') . '</a></div>', $post_id);
}
开发者ID:studioaceofspade,项目名称:conrad-grebel-wordpress,代码行数:28,代码来源:ajax-load.php

示例5: cfct_banner

<?php

// This file is part of the Carrington Mobile Theme for WordPress
// http://carringtontheme.com
//
// Copyright (c) 2008-2010 Crowd Favorite, Ltd. All rights reserved.
// http://crowdfavorite.com
//
// Released under the GPL license
// http://www.opensource.org/licenses/gpl-license.php
//
// **********************************************************************
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// **********************************************************************
if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) {
    die;
}
if (CFCT_DEBUG) {
    cfct_banner(__FILE__);
}
if (have_posts()) {
    while (have_posts()) {
        the_post();
        cfct_content();
    }
}
开发者ID:rascoop,项目名称:carrington,代码行数:28,代码来源:page.php


注:本文中的cfct_content函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。