コード例 #1
0
/**
 * Rebuilds the default terms array keyed by taxonomy/slug
 * @param type $terms
 * @return type
 */
function _mpp_build_terms_array(&$terms)
{
    //builds like
    //$array('mpp-taxonomy'=> array( 'term_slug' => $term_object ));
    $new_terms = array();
    foreach ($terms as $term) {
        $new_terms[$term->taxonomy][mpp_strip_underscore($term->slug)] = $term;
    }
    return $new_terms;
}
コード例 #2
0
ファイル: functions.php プロジェクト: baden03/mediapress
/**
 * 
 * @param type $object
 * @return string type slug(used to uniquely identify this component) e.g (members|groups|events etc)
 */
function mpp_get_object_component($object)
{
    $term_id = mpp_get_object_component_term_id($object);
    $slug = '';
    //now get the slug for this status
    $component = mpp_get_component_object($term_id);
    if (isset($component->slug)) {
        $slug = $component->slug;
    }
    return mpp_strip_underscore($slug);
}