本文整理汇总了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>';
}
示例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();
}
示例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();
}
示例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);
}
示例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();
}
}