예제 #1
0
function fp_get_tax_values($postid, $tmp_sep = " | ")
{
    $tax_list = array_merge(array("category", "post_tag"), fp_array_remove_blanks(fp_default_tax_list()));
    $post_terms = wp_get_post_terms($postid, $tax_list, array("fields" => "all"));
    $tmp_output = "";
    foreach ($tax_list as $key => $tax_slug) {
        $term_list = array();
        foreach ($post_terms as $term) {
            if ($term->taxonomy == $tax_slug) {
                $term_link = get_term_link($term);
                if (!is_wp_error($term_link)) {
                    $term_list[$term->slug] = '<a href="' . esc_url($term_link) . '">' . $term->name . '</a>';
                }
            }
        }
        if (count($term_list) > 0) {
            $tmp_output .= $tmp_sep . fp_get_tax_label($tax_slug) . ": ";
            $tmp_output .= implode(", ", $term_list);
        }
    }
    // foreach tax names
    return $tmp_output;
}
	<?php 
//**********************************************************************************
//* Taxonomies
//**********************************************************************************
//$tax_list = array("category", "group", "article-type");
$tax_list = $frontier_custom_tax;
$tax_layout_list = fp_get_tax_layout($frontier_custom_tax, $frontier_custom_tax_layout);
echo '<tr><td class="frontier_no_border">';
foreach ($tax_layout_list as $tmp_tax_name => $tmp_tax_layout) {
    if ($tmp_tax_layout != "hide") {
        // Cats_selected is set from script, but only for category
        if ($tmp_tax_name != 'category') {
            $cats_selected = wp_get_post_terms($thispost->ID, $tmp_tax_name, array("fields" => "ids"));
        }
        echo '<fieldset class="frontier_post_fieldset_tax frontier_post_fieldset_tax_' . $tmp_tax_name . '">';
        echo '<legend class="frontier_post_legend_tax" >' . fp_get_tax_label($tmp_tax_name) . '</legend>';
        frontier_tax_input($thispost->ID, $tmp_tax_name, $tmp_tax_layout, $cats_selected, $frontier_post_shortcode_parms, $tax_form_lists[$tmp_tax_name]);
        echo '</fieldset>';
        echo PHP_EOL;
    }
}
if (current_user_can('frontier_post_tags_edit') || fp_get_option_bool("fps_show_feat_img")) {
    //****************************************************************************************************
    // tags
    //****************************************************************************************************
    if (current_user_can('frontier_post_tags_edit')) {
        echo '<fieldset class="frontier_post_fieldset_tax frontier_post_fieldset_tax_tag">';
        echo '<legend>' . __("Tags", "frontier-post") . '</legend>';
        for ($i = 0; $i < $fp_tag_count; $i++) {
            $tmp_tag = isset($taglist[$i]) ? fp_tag_transform($taglist[$i]) : "";
            //$tmp_tag = array_key_exists($i, $taglist) ? fp_tag_transform($taglist[$i]) : "";
예제 #3
0
function fp_get_tax_values($postid)
{
    $tax_list = array_merge(array("category", "post_tag"), fp_default_tax_list());
    $tmp_output = "";
    foreach ($tax_list as $tmp_tax) {
        $tax_values = wp_get_post_terms($postid, $tmp_tax, array("fields" => "names"));
        if (count($tax_values) > 0) {
            //$tmp_output .= '<div class="frontier-post-tax-label" id="frontier-post-tax-label-'.$tmp_tax.'">';
            //$tmp_output .= '<div class="frontier-post-tax-list" id="frontier-post-tax-list-'.$tmp_tax.'">';
            $tmp_output .= fp_get_tax_label($tmp_tax) . ": ";
        }
        $tmp_output .= implode(", ", $tax_values) . " | ";
    }
    //echo $tmp_tax." ---> ".print_r($tax_values, true)."<br>";
    return $tmp_output;
}