• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_term_link函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: get_url

 /**
  * get_url - Returns a url based on a string that holds either post type and id or taxonomy and id
  */
 static function get_url($link, $post_id = false)
 {
     $link = explode(',', $link);
     if ($link[0] == 'lightbox') {
         $link = wp_get_attachment_image_src($post_id, apply_filters('avf_avia_builder_helper_lightbox_size', 'large'));
         return $link[0];
     }
     if (empty($link[1])) {
         return $link[0];
     }
     if ($link[0] == 'manually') {
         return $link[1];
     }
     if (post_type_exists($link[0])) {
         return get_permalink($link[1]);
     }
     if (taxonomy_exists($link[0])) {
         $return = get_term_link(get_term($link[1], $link[0]));
         if (is_object($return)) {
             $return = "";
         }
         //if an object is returned it is a WP_Error object and something was not found
         return $return;
     }
 }
开发者ID:erynet,项目名称:SUAWEBv2,代码行数:28,代码来源:generic-helper.class.php


示例2: get_rocket_post_terms_urls

/**
 * Get all terms archives urls associated to a specific post
 *
 * @since 1.0
 *
 * @param int $post_ID The post ID
 * @return array $urls List of taxonomies URLs
 */
function get_rocket_post_terms_urls($post_ID)
{
    $urls = array();
    $taxonomies = get_object_taxonomies(get_post_type($post_ID), 'objects');
    foreach ($taxonomies as $taxonomy) {
        if (!$taxonomy->public) {
            continue;
        }
        // Get the terms related to post
        $terms = get_the_terms($post_ID, $taxonomy->name);
        if (!empty($terms)) {
            foreach ($terms as $term) {
                $term_url = get_term_link($term->slug, $taxonomy->name);
                if (!is_wp_error($term_url)) {
                    $urls[] = $term_url;
                }
            }
        }
    }
    /**
     * Filter the list of taxonomies URLs
     *
     * @since 1.1.0
     *
     * @param array $urls List of taxonomies URLs
     */
    $urls = apply_filters('rocket_post_terms_urls', $urls);
    return $urls;
}
开发者ID:EliasGoldberg,项目名称:troop-sim,代码行数:37,代码来源:posts.php


示例3: enlightenment_project_types_filter

function enlightenment_project_types_filter($args = null)
{
    $args = array('container' => 'ul', 'container_class' => 'project-types-filter', 'term_tag' => 'li', 'term_class' => 'project-type', 'current_term_class' => 'current-project-type', 'sep' => '', 'echo' => true);
    $args = apply_filters('enlightenment_project_types_filter_args', $args);
    $terms = get_terms('jetpack-portfolio-type');
    $output = '';
    if (!empty($terms)) {
        $output .= enlightenment_open_tag($args['container'], $args['container_class']);
        if (is_tax('jetpack-portfolio-type')) {
            $output .= enlightenment_open_tag($args['term_tag'], $args['term_class']);
            $output .= sprintf('<a href="%1$s" rel="%2$s">%3$s</a>', get_post_type_archive_link('jetpack-portfolio'), 'jetpack-portfolio-type', __('All', 'enlightenment'));
            $output .= enlightenment_close_tag($args['term_tag']);
        }
        foreach ($terms as $term) {
            $class = $args['term_class'];
            $link = get_term_link($term, $term->taxonomy);
            $current_url = sprintf('%1$s%2$s%3$s', is_ssl() ? 'https://' : 'http://', $_SERVER['HTTP_HOST'], $_SERVER['REQUEST_URI']);
            if ($link == $current_url) {
                $class .= ' ' . $args['current_term_class'];
            }
            $output .= enlightenment_open_tag($args['term_tag'], $class);
            $output .= sprintf('<a href="%1$s" rel="%2$s">%3$s</a>', $link, $term->taxonomy, $term->name);
            $output .= enlightenment_close_tag($args['term_tag']);
        }
        $output .= enlightenment_close_tag($args['container']);
    }
    $output = apply_filters('enlightenment_project_types_filter', $output);
    if (!$args['echo']) {
        return $output;
    }
    echo $output;
}
开发者ID:thano,项目名称:cfpi-theme-2016,代码行数:32,代码来源:jetpack-portfolio.php


示例4: portfolioTypes

    function portfolioTypes()
    {
        $portfolioTypes = get_terms('portfolio-type', 'orderby=id&order=ASC');
        if (count($portfolioTypes) > 0) {
            //current term
            $currentTermId = is_tax('portfolio-type') ? get_queried_object()->term_id : "";
            ?>
<ol class="breadcrumb">
                  <?php 
            foreach ($portfolioTypes as $types) {
                $activeClass = $currentTermId == $types->term_id ? " active " : "";
                ?>
                     <li class="gallery-type term-<?php 
                echo esc_attr($types->slug);
                echo esc_attr($activeClass);
                ?>
 term-id-<?php 
                echo esc_attr($types->term_id);
                ?>
">
                     <a href="<?php 
                echo esc_url(get_term_link($types));
                ?>
"><?php 
                echo esc_html($types->name);
                ?>
</a>
                     </li>
                 <?php 
            }
            ?>
                </ol><?php 
        }
    }
开发者ID:Angelpm28,项目名称:ong-canada,代码行数:34,代码来源:portfolio-hooks.php


示例5: prepare_data

 protected function prepare_data($data)
 {
     $term_id = intval($data[0]);
     $taxonomy = $data[1];
     $url = get_term_link($term_id, $taxonomy);
     return array('url' => $url);
 }
开发者ID:kingkool68,项目名称:wordpress-cdn-integration,代码行数:7,代码来源:class-pre-delete-term.php


示例6: start_el

 /**
  * @see Walker::start_el()
  * @since 2.1.0
  *
  * @param string $output Passed by reference. Used to append additional content.
  * @param object $category Category data object.
  * @param int $depth Depth of category in reference to parents.
  * @param integer $current_object_id
  */
 function start_el(&$output, $cat, $depth = 0, $args = array(), $current_object_id = 0)
 {
     $term_meta = get_option("taxonomy_{$cat->term_id}");
     $output .= '<li class="list-group-item cat-item cat-item-' . $cat->term_id;
     if ($args['current_category'] == $cat->term_id) {
         $output .= ' current-cat';
     }
     if ($args['has_children'] && $args['hierarchical']) {
         $output .= ' cat-parent';
     }
     if ($args['current_category_ancestors'] && $args['current_category'] && in_array($cat->term_id, $args['current_category_ancestors'])) {
         $output .= ' current-cat-parent';
     }
     $output .= '"><a href="' . get_term_link((int) $cat->term_id, 'product_cat') . '">';
     if (isset($term_meta['icon']) && $term_meta['icon'] != '') {
         $output .= '<i class="fa ' . $term_meta['icon'] . '"></i>';
     } else {
         //$output .=	'<i class="fa fa-star"></i>';
     }
     $output .= '<span class="heading">';
     $output .= '<span class="menu-title">' . __($cat->name, 'woocommerce') . '</span>';
     if ($cat->category_description != '') {
         $output .= '<span class="menu-desc">' . wpo_string_limit_words($cat->category_description, 5) . '</span>';
     }
     $output .= '</span>';
     $output .= '</a>';
     if ($args['show_count']) {
         $output .= ' <span class="badge count">(' . $cat->count . ')</span>';
     }
 }
开发者ID:WestBayResidential,项目名称:wbrsorg,代码行数:39,代码来源:product-cat-list.php


示例7: add_new_category

function add_new_category()
{
    if (is_user_logged_in()) {
        if (isset($_POST['cat_name']) && !empty($_POST['cat_name']) && isset($_POST['parent_id']) && !empty($_POST['parent_id'])) {
            $cat_name = esc_html($_POST['cat_name']);
            $parent_id = esc_html($_POST['parent_id']);
            $new_cat_args = array($cat_name, 'bookmark-category');
            if ($parent_id == -1) {
                // Add Term to Bookmark Category
                $new_category = wp_insert_term($cat_name, 'bookmark-category');
            } else {
                // Add Term to Bookmark Category
                $new_category = wp_insert_term($cat_name, 'bookmark-category', array('parent' => $parent_id));
            }
            if (!is_wp_error($new_category)) {
                $term = get_term_by('id', $new_category['term_id'], 'bookmark-category');
                // Add Term to User
                wp_set_object_terms($current_user->ID, array($term->slug), 'bookmark-category', true);
                $returner = array('success' => true, 'cat_id' => $new_category['term_id'], 'cat_slug' => $term->slug, 'cat_link' => get_term_link($term, 'bookmark-category'));
            } else {
                $returner = array('success' => false, 'reason' => 'WP Error on term creation.');
            }
        } else {
            $returner = array('success' => false, 'reason' => 'Post values not set.');
        }
    } else {
        $returner = array('success' => false, 'reason' => 'User not logged in.');
    }
    echo json_encode($returner);
    exit;
}
开发者ID:ryan-frankel,项目名称:nerdmash,代码行数:31,代码来源:add_new_category.php


示例8: redirection

 /**
  * will redirect old links to new link structures.
  */
 public static function redirection()
 {
     global $wpdb, $wp_query;
     if (is_object($wp_query) && $wp_query->get('em_redirect')) {
         //is this a querystring url?
         if ($wp_query->get('event_slug')) {
             $event = $wpdb->get_row('SELECT event_id, post_id FROM ' . EM_EVENTS_TABLE . " WHERE event_slug='" . $wp_query->get('event_slug') . "' AND (blog_id=" . get_current_blog_id() . " OR blog_id IS NULL OR blog_id=0)", ARRAY_A);
             if (!empty($event)) {
                 $EM_Event = em_get_event($event['event_id']);
                 $url = get_permalink($EM_Event->post_id);
             }
         } elseif ($wp_query->get('location_slug')) {
             $location = $wpdb->get_row('SELECT location_id, post_id FROM ' . EM_LOCATIONS_TABLE . " WHERE location_slug='" . $wp_query->get('location_slug') . "' AND (blog_id=" . get_current_blog_id() . " OR blog_id IS NULL OR blog_id=0)", ARRAY_A);
             if (!empty($location)) {
                 $EM_Location = em_get_location($location['location_id']);
                 $url = get_permalink($EM_Location->post_id);
             }
         } elseif ($wp_query->get('category_slug')) {
             $url = get_term_link($wp_query->get('category_slug'), EM_TAXONOMY_CATEGORY);
         }
         if (!empty($url)) {
             wp_redirect($url, 301);
             exit;
         }
     }
 }
开发者ID:pcco,项目名称:portal-redesign,代码行数:29,代码来源:em-permalinks.php


示例9: ubik_places_ancestors

function ubik_places_ancestors($taxonomy = 'places', $depth = 2, $sep = ', ')
{
    // Initialize
    $output = '';
    $places = array();
    // Get term ID; we only need one
    global $post;
    $terms = get_the_terms($post->ID, $taxonomy);
    $term = $terms[0];
    // Only proceed if this term shows inheritance
    if (!empty($term->parent)) {
        // The grunt work
        $ancestors = ubik_terms_ancestors($term->term_id, $taxonomy);
        // Ready to roll
        if (!empty($ancestors) && count($ancestors) > 1) {
            // Remove basal term, limit depth, and reverse (as is the custom for displaying places)
            $ancestors = array_reverse(array_slice(array_slice($ancestors, 0, -1), 0, $depth));
            // Loop through all ancestors and create links
            if (!empty($ancestors)) {
                foreach ($ancestors as $ancestor) {
                    $place = get_term_by('id', $ancestor, $taxonomy);
                    $places[] = '<a href="' . get_term_link($place->term_id, $taxonomy) . '" rel="tag">' . $place->name . '</a>';
                }
                // Assemble output
                if (!empty($places)) {
                    $output = implode($sep, $places);
                }
            }
        }
    }
    return $output;
}
开发者ID:synapticism,项目名称:ubik-places,代码行数:32,代码来源:ubik-places-core.php


示例10: ap_question_categories_html

/**
 * Output question categories
 * @param  array $args
 * @return string
 */
function ap_question_categories_html($args = array())
{
    $defaults = array('question_id' => get_the_ID(), 'list' => false, 'tag' => 'span', 'class' => 'question-categories', 'label' => __('Categories', 'categories-for-anspress'), 'echo' => false);
    if (!is_array($args)) {
        $defaults['question_id'] = $args;
        $args = $defaults;
    } else {
        $args = wp_parse_args($args, $defaults);
    }
    $cats = get_the_terms($args['question_id'], 'question_category');
    if ($cats) {
        $o = '';
        if ($args['list']) {
            $o = '<ul class="' . $args['class'] . '">';
            foreach ($cats as $c) {
                $o .= '<li><a href="' . esc_url(get_term_link($c)) . '" title="' . $c->description . '">' . $c->name . '</a></li>';
            }
            $o .= '</ul>';
        } else {
            $o = $args['label'];
            $o .= '<' . $args['tag'] . ' class="' . $args['class'] . '">';
            foreach ($cats as $c) {
                $o .= '<a href="' . esc_url(get_term_link($c)) . '" title="' . $c->description . '">' . $c->name . '</a>';
            }
            $o .= '</' . $args['tag'] . '>';
        }
        if ($args['echo']) {
            echo $o;
        }
        return $o;
    }
}
开发者ID:cowlicker12,项目名称:categories-for-anspress,代码行数:37,代码来源:functions.php


示例11: tags

 public function tags()
 {
     if (!did_action('pre_get_posts')) {
         return array();
     }
     $queried_object = get_queried_object();
     $tags = array();
     $default_tags = array('og:type' => 'website', 'og:locale' => get_locale(), 'og:site_name' => get_bloginfo('name'), 'og:image' => $this->get_image_url());
     if (is_front_page()) {
         $tags = array('og:url' => home_url('/'), 'og:title' => get_bloginfo('name'), 'og:description' => get_bloginfo('description'));
     } else {
         if (is_singular()) {
             $tags = array('og:type' => 'article', 'og:url' => get_permalink($queried_object), 'og:title' => get_the_title($queried_object), 'og:description' => $this->generate_preview($queried_object->post_content), 'article:published_time' => date('c', strtotime($queried_object->post_date_gmt)), 'article:modified_time' => date('c', strtotime($queried_object->post_modified_gmt)), 'article:author' => get_author_posts_url($queried_object->post_author));
         } else {
             if (is_tax() || is_category() || is_tag()) {
                 $tags = array('og:url' => get_term_link($queried_object), 'og:title' => $queried_object->name, 'og:description' => $this->generate_preview($queried_object->description));
             } else {
                 if (is_author()) {
                     $tags = array('og:type' => 'profile', 'og:url' => get_author_posts_url($queried_object->ID), 'og:title' => $queried_object->display_name, 'og:description' => $this->generate_preview($queried_object->user_description), 'profile:first_name' => get_the_author_meta('first_name', $queried_object->ID), 'profile:last_name' => get_the_author_meta('last_name', $queried_object->ID));
                 }
             }
         }
     }
     $tags = array_merge($default_tags, $tags);
     return apply_filters('appthemes_open_graph_meta_tags', $tags);
 }
开发者ID:kalushta,项目名称:darom,代码行数:26,代码来源:open-graph.php


示例12: pronamic_framework_shortcode_terms_index

/**
 * Shortcode terms index
 */
function pronamic_framework_shortcode_terms_index($atts)
{
    extract(shortcode_atts(array('taxonomy' => null, 'parent' => 0), $atts));
    $result = '';
    if ($taxonomy) {
        $terms = get_terms($taxonomy);
        $alphabet = array();
        foreach ($terms as $term) {
            $letter = strtoupper(substr($term->name, 0, 1));
            if (!isset($alphabet[$letter])) {
                $alphabet[$letter] = array();
            }
            $alphabet[$letter][] = $term;
        }
        if (!empty($alphabet)) {
            $result .= '<ul class="pronamic-terms-index-list">';
            foreach ($alphabet as $letter => $terms) {
                $result .= '<li>';
                $result .= $letter;
                if (!empty($terms)) {
                    $result .= '<ul>';
                    foreach ($terms as $term) {
                        $result .= '<li>';
                        $result .= sprintf('<a href="%s">%s</a>', get_term_link($term), $term->name);
                        $result .= '</li>';
                    }
                    $result .= '</ul>';
                }
                $result .= '</li>';
            }
            $result .= '</ul>';
        }
    }
    return $result;
}
开发者ID:joffcrabtree,项目名称:wp-pronamic-framework,代码行数:38,代码来源:shortcode-terms-index.php


示例13: permalink

 public function permalink()
 {
     $permalink = get_term_link($this->term_id, $this->taxonomy);
     if (!is_wp_error($permalink)) {
         return $this->permalink = $permalink;
     }
 }
开发者ID:expresser,项目名称:taxonomy,代码行数:7,代码来源:Base.php


示例14: browse_displays

function browse_displays()
{
    $custom_taxonomy = 'gallery-wing';
    $custom_terms = get_terms($custom_taxonomy);
    $str_return = '<ul>';
    foreach ($custom_terms as $custom_term) {
        wp_reset_query();
        $args = array('post_type' => 'display', 'tax_query' => array(array('taxonomy' => $custom_taxonomy, 'field' => 'slug', 'terms' => $custom_term->slug, 'include_children' => false)));
        $loop = new WP_Query($args);
        $term_name = $custom_term->name;
        $term_slug = $custom_term->slug;
        $term_link = get_term_link($term_slug, $custom_taxonomy);
        $str_return .= '<li><a href="' . $term_link . '">' . $term_name . '</a>';
        if ($loop->have_posts()) {
            $str_return .= '<ol>';
            while ($loop->have_posts()) {
                $loop->the_post();
                $str_return .= '<li><a href="' . get_permalink() . '">' . get_the_title() . '</a></li> ';
            }
            $str_return .= '</ol>';
        }
        $str_return .= '</li>';
    }
    $str_return .= '</ul>';
    return $str_return;
}
开发者ID:uwmadisoncals,项目名称:vmmm,代码行数:26,代码来源:functions.php


示例15: populate_form_array

 /**
  * Generate the form configuration array for this tab
  *
  * @since  0.1
  * @access private
  */
 private function populate_form_array()
 {
     // define the sections
     $this->sections = array('locations' => array('title' => _x('Page Slugs', 'page locations section title', 'wpsc'), 'fields' => array('store_slug', 'store_as_front_page', 'category_base_slug', 'product_base_slug', 'cart_page_slug', 'checkout_page_slug', 'customer_account_page_slug', 'login_page_slug', 'password_reminder_page_slug', 'register_page_slug', 'prefix_product_slug', 'hierarchical_product_category_url')), 'titles' => array('title' => _x('Page Titles', 'page titles section title', 'wpsc'), 'fields' => array('store_title', 'cart_page_title', 'checkout_page_title', 'customer_account_page_title', 'login_page_title', 'password_reminder_page_title', 'register_page_title')));
     // Shortcut variables for buttons and messages
     $view_button = '<a class="button button-secondary button-view-page" href="%1$s">%2$s</a>';
     $view_message = _x('View', 'view page', 'wpsc');
     $view_category_message = _x('Sample Category', 'view page', 'wpsc');
     $view_product_message = _x('Sample Product', 'view page', 'wpsc');
     // generate sample URLs for single product and product category
     $base_shop_url = '<small>' . esc_url(wpsc_get_store_url('/')) . '</small>';
     $sample_category = get_terms('wpsc_product_category', array('number' => 1));
     $sample_product = get_posts(array('post_type' => 'wpsc-product', 'numberposts' => 1));
     // generate form fields
     $this->form_array = array('store_slug' => array('type' => 'textfield', 'prepend' => '<small>' . esc_url(home_url('/')) . '</small>', 'title' => _x('Main store', 'page slug setting', 'wpsc'), 'append' => sprintf($view_button, wpsc_get_store_url(), $view_message), 'validation' => 'required', 'class' => 'regular-text'), 'store_as_front_page' => array('type' => 'radios', 'title' => _x('Display main store on front page', 'page settings', 'wpsc'), 'options' => array(1 => _x('Yes', 'settings', 'wpsc'), 0 => _x('No', 'settings', 'wpsc'))), 'store_title' => array('type' => 'textfield', 'title' => _x('Main store title', 'page slug title', 'wpsc'), 'validation' => 'required'), 'category_base_slug' => array('type' => 'textfield', 'prepend' => $base_shop_url, 'append' => empty($sample_category) ? '' : sprintf($view_button, get_term_link($sample_category[0]), $view_category_message), 'title' => _x('Product category base slug', 'permalinks setting', 'wpsc'), 'validation' => 'required', 'class' => 'regular-text'), 'product_base_slug' => array('type' => 'textfield', 'prepend' => $base_shop_url, 'append' => empty($sample_product) ? '' : sprintf($view_button, get_permalink($sample_product[0]), $view_product_message), 'title' => _x('Single product base slug', 'permalinks setting', 'wpsc'), 'validation' => 'required', 'class' => 'regular-text'), 'prefix_product_slug' => array('type' => 'checkboxes', 'title' => _x('Product prefix', 'permalinks setting', 'wpsc'), 'options' => array(1 => __('Include category slug in product URL.', 'wpsc'))), 'hierarchical_product_category_url' => array('type' => 'radios', 'title' => _x('Hierarchical product category URL', 'permalinks setting', 'wpsc'), 'options' => array(1 => _x('Yes', 'settings', 'wpsc'), 0 => _x('No', 'settings', 'wpsc')), 'description' => __('When hierarchical product category URL is enabled, parent product categories are also included in the product URL.', 'wpsc')), 'cart_page_slug' => array('type' => 'textfield', 'prepend' => $base_shop_url, 'append' => sprintf($view_button, wpsc_get_cart_url(), $view_message), 'title' => _x('Cart page', 'page settings', 'wpsc'), 'validation' => 'required', 'class' => 'regular-text'), 'cart_page_title' => array('type' => 'textfield', 'title' => _x('Cart page', 'page settings', 'wpsc'), 'validation' => 'required'), 'checkout_page_slug' => array('type' => 'textfield', 'prepend' => $base_shop_url, 'title' => _x('Checkout page', 'page setting', 'wpsc'), 'validation' => 'required', 'class' => 'regular-text'), 'checkout_page_title' => array('type' => 'textfield', 'title' => _x('Checkout page', 'page settings', 'wpsc'), 'validation' => 'required'), 'customer_account_page_slug' => array('type' => 'textfield', 'prepend' => $base_shop_url, 'append' => sprintf($view_button, wpsc_get_customer_account_url(), $view_message), 'title' => _x('Customer account page', 'permalinks setting', 'wpsc'), 'validation' => 'required|slug_not_conflicted', 'class' => 'regular-text'), 'customer_account_page_title' => array('type' => 'textfield', 'title' => _x('Customer account page', 'page settings', 'wpsc'), 'validation' => 'required'), 'login_page_slug' => array('type' => 'textfield', 'prepend' => $base_shop_url, 'title' => _x('Login page', 'permalinks setting', 'wpsc'), 'description' => __('Leaving this field blank will disable the page.', 'wpsc'), 'validation' => 'slug_not_conflicted', 'class' => 'regular-text'), 'login_page_title' => array('type' => 'textfield', 'title' => _x('Login page', 'page settings', 'wpsc'), 'validation' => 'required'), 'password_reminder_page_slug' => array('type' => 'textfield', 'prepend' => $base_shop_url, 'title' => _x('Password reminder page', 'permalinks setting', 'wpsc'), 'description' => __("Leaving this field blank will disable the page.", 'wpsc'), 'validation' => 'slug_not_conflicted', 'class' => 'regular-text'), 'password_reminder_page_title' => array('type' => 'textfield', 'title' => _x('Password reminder page', 'page settings', 'wpsc'), 'validation' => 'required'), 'register_page_slug' => array('type' => 'textfield', 'prepend' => $base_shop_url, 'title' => _x('Register page', 'permalinks setting', 'wpsc'), 'description' => __("Leaving this field blank will disable the page.", 'wpsc'), 'validation' => 'slug_not_conflicted', 'class' => 'regular-text'), 'register_page_title' => array('type' => 'textfield', 'title' => _x('Register page', 'page settings', 'wpsc'), 'validation' => 'required'));
     // display warnings for login, register and password reminder pages when
     // "Anyone can register" is disabled.
     if (!get_option('users_can_register')) {
         $additional_description = '<br /> ' . __('<strong>Note:</strong> Enable "Anyone can register" in <a href="%s">Settings -> General</a> first if you want to use this page.', 'wpsc');
         $additional_description = sprintf($additional_description, admin_url('options-general.php'));
         $this->form_array['login_page_slug']['description'] .= $additional_description;
         $this->form_array['password_reminder_page_slug']['description'] .= $additional_description;
         $this->form_array['register_page_slug']['description'] .= $additional_description;
     }
 }
开发者ID:RJHanson292,项目名称:WP-e-Commerce,代码行数:31,代码来源:settings-pages.php


示例16: get_target_url

 /**
  * Get the URL to the term and returns it's path
  *
  * @param string $tag
  * @param string $taxonomy
  *
  * @return string
  */
 protected function get_target_url($tag, $taxonomy)
 {
     // Use the correct URL path
     $url = parse_url(get_term_link($tag, $taxonomy));
     $url = $url['path'];
     return $url;
 }
开发者ID:shyaken,项目名称:maoy.palt,代码行数:15,代码来源:class-term-watcher.php


示例17: ap_question_categories_html

function ap_question_categories_html($post_id = false, $list = true)
{
    if (!ap_opt('enable_categories')) {
        return;
    }
    if (!$post_id) {
        $post_id = get_the_ID();
    }
    $cats = get_the_terms($post_id, 'question_category');
    if ($cats) {
        if ($list) {
            $o = '<ul class="question-categories">';
            foreach ($cats as $c) {
                $o .= '<li><a href="' . esc_url(get_term_link($c)) . '" title="' . $c->description . '">' . $c->name . '</a></li>';
            }
            $o .= '</ul>';
            echo $o;
        } else {
            $o = 'Categories:';
            $o .= ' <span class="question-categories-list">';
            foreach ($cats as $c) {
                $o .= '<a href="' . esc_url(get_term_link($c)) . '" title="' . $c->description . '">' . $c->name . '</a>';
            }
            $o .= '</span>';
            echo $o;
        }
    }
}
开发者ID:coollog,项目名称:theboola,代码行数:28,代码来源:anspress-categories.php


示例18: road_popular_categories_shortcode

function road_popular_categories_shortcode($atts)
{
    $atts = shortcode_atts(array('category' => '', 'image' => ''), $atts, 'popular_categories');
    $html = '';
    $html .= '<div class="category-wrapper">';
    $pcategory = get_term_by('slug', $atts['category'], 'product_cat', 'ARRAY_A');
    if ($pcategory) {
        $html .= '<div class="category-list">';
        $html .= '<h3><a href="' . get_term_link($pcategory['slug'], 'product_cat') . '">' . $pcategory['name'] . '</a></h3>';
        $html .= '<ul>';
        $args2 = array('taxonomy' => 'product_cat', 'child_of' => 0, 'parent' => $pcategory['term_id'], 'orderby' => 'name', 'show_count' => 0, 'pad_counts' => 0, 'hierarchical' => 0, 'title_li' => '', 'hide_empty' => 0);
        $sub_cats = get_categories($args2);
        if ($sub_cats) {
            foreach ($sub_cats as $sub_category) {
                $html .= '<li><a href="' . get_term_link($sub_category->slug, 'product_cat') . '">' . $sub_category->name . '</a></li>';
            }
        }
        $html .= '</ul>';
        $html .= '</div>';
        if ($atts['image'] != '') {
            $html .= '<div class="cat-img">';
            $html .= '<a href="' . get_term_link($pcategory['slug'], 'product_cat') . '"><img class="category-image" src="' . esc_attr($atts['image']) . '" alt="" /></a>';
            $html .= '</div>';
        }
    }
    $html .= '</div>';
    return $html;
}
开发者ID:roadthemez,项目名称:roadthemes,代码行数:28,代码来源:popularcategories.php


示例19: start_el

 /**
  * @see Walker::start_el()
  * @since 2.1.0
  *
  * @param string $output Passed by reference. Used to append additional content.
  * @param object $category Category data object.
  * @param int $depth Depth of category in reference to parents.
  * @param array $args
  */
 function start_el(&$output, $cat, $depth = 0, $args = array(), $current_object_id = 0)
 {
     if (!empty($args['hierarchical'])) {
         $pad = str_repeat('&nbsp;', $depth * 3);
     } else {
         $pad = '';
     }
     if ($args['show_portfolio'] == 'yes') {
         $font_weight = 'style="font-weight:bold" ';
     } else {
         $font_weight = '';
     }
     $current_cat_name = '';
     $output .= '<option ' . $font_weight . 'class="level-' . $depth . '" data-id="' . $cat->term_id . '" value="' . get_term_link((int) $cat->term_id, 'portfolio_cat') . '" ';
     if ($args['current_category'] == $cat->term_id) {
         $output .= ' selected="selected"';
     }
     $output .= '>' . $pad . '<strong>' . $cat->name . '</strong>';
     if ($args['show_count']) {
         $output .= ' <span class="count">&nbsp;(' . $cat->count . ')</span>';
     }
     if ($args['show_portfolio'] == 'yes') {
         $output .= $this->get_portfolio($args['current_portfolio'], $cat->term_id, $cat->slug, $args['portfolio_orderby'], $args['hierarchical'], $depth, $pad);
     }
 }
开发者ID:manhhung86it,项目名称:builder-site,代码行数:34,代码来源:class-portfolio-categories-list-dropdown-walker.php


示例20: _zn_documentation

function _zn_documentation($options)
{
    $categories = get_terms('documentation_category', array('orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 0, 'show_count ' => 1));
    $limit = '6';
    if (!empty($options['doc_num_items'])) {
        $limit = $options['doc_num_items'];
    }
    $count = count($categories);
    $i = 1;
    foreach ($categories as $category) {
        if ($i % 2 == 1) {
            echo '<div class="row-fluid zn_photo_gallery">';
        }
        echo '<div class="span6">';
        echo '<h3><a href="' . get_term_link($category->slug, 'documentation_category') . '">' . $category->name . ' (' . $category->count . ')</a></h3>';
        $args = array('post_type' => 'documentation', 'post_status' => 'publish', 'posts_per_page' => $limit, 'documentation_category' => $category->slug);
        $zn_doc = new WP_Query($args);
        echo '<ol>';
        while ($zn_doc->have_posts()) {
            $zn_doc->the_post();
            global $post;
            echo '<li><a href="' . get_permalink() . '">' . get_the_title() . '</a></li>';
        }
        // end loop
        echo "</ol>";
        echo '</div>';
        if ($i % 2 == 0 || $i == $count) {
            echo '</div>';
        }
        $i++;
    }
}
开发者ID:sumovska,项目名称:jodi,代码行数:32,代码来源:_zn_documentation.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_term_meta函数代码示例发布时间:2022-05-15
下一篇:
PHP get_term_field函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap