コード例 #1
0
function get_budget_items($params = array())
{
    global $budget_orderby, $budget_order;
    $defaults = array('orderby' => 'file_time', 'order' => 'ASC');
    $budget_orderby = 'importance';
    $budget_order = 'DESC';
    $dates = array(date_i18n('Y-m-d'));
    if (!empty($_GET['file_dates'])) {
        $ndates = explode(',', $_GET['file_dates']);
        foreach ($ndates as $i => $d) {
            if (date('Y', strtotime($d)) < 2000) {
                unset($ndates[$i]);
            } else {
                $ndates[$i] = date('Y-m-d', strtotime($d));
            }
        }
    }
    if (!empty($ndates)) {
        $dates = $ndates;
    }
    $args = array('post_type' => 'doc', 'tax_query' => array(array('taxonomy' => 'day', 'field' => 'slug', 'terms' => $dates), array('taxonomy' => 'publication', 'field' => 'slug', 'terms' => 'bangordailynews-com')), 'numberposts' => '-1');
    $posts = get_posts($args);
    foreach ($posts as $i => $p) {
        $posts[$i] = budget_set_up_item($p);
    }
    usort($posts, 'budget_sort');
    return $posts;
}
コード例 #2
0
        echo $desk->name;
        ?>
				</h4>
				<ul class="sortable">
					<?php 
        $stories = get_posts(array('desk' => $desk->slug, 'post_type' => 'doc', 'tax_query' => array(array('taxonomy' => 'status', 'field' => 'slug', 'terms' => 'final-published', 'operator' => 'NOT IN')), 'meta_query' => array(array('key' => '_the_file_time', 'value' => date_i18n('Y-m-d 23:59'), 'compare' => '<')), 'numberposts' => -1));
        ?>
						<?php 
        if (empty($stories) || count($stories) == 0) {
            echo '</ul>';
            continue;
        }
        ?>
						<?php 
        foreach ($stories as $i => $story) {
            $stories[$i] = budget_set_up_item($story);
        }
        $GLOBALS['budget_orderby'] = 'importance';
        $GLOBALS['budget_order'] = 'DESC';
        usort($stories, 'budget_sort');
        ?>

						<?php 
        foreach ($stories as $i => $post) {
            ?>
							<?php 
            if (in_array($post->ID, $used)) {
                continue;
            }
            ?>
							<?php 
コード例 #3
0
function get_budget_item_multi($post = false, $item = 'folders')
{
    if (empty($post)) {
        global $post;
    }
    if (empty($post->{$item})) {
        $post = budget_set_up_item($post);
    }
    $items = array();
    foreach ($post->{$item} as $i) {
        $items[] = $i->name;
    }
    return $items;
}