本文整理汇总了PHP中get_terms函数的典型用法代码示例。如果您正苦于以下问题:PHP get_terms函数的具体用法?PHP get_terms怎么用?PHP get_terms使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_terms函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: html
/**
* Get field HTML
*
* @param $html
* @param $field
* @param $meta
*
* @return string
*/
static function html($html, $meta, $field)
{
$options = $field['options'];
$terms = get_terms($options['taxonomy'], $options['args']);
$html = '';
// Checkbox LIST
if ('checkbox_list' === $options['type']) {
$html = array();
foreach ($terms as $term) {
$checked = checked(in_array($term->slug, $meta), true, false);
$html[] = "<label><input type='checkbox' name='{$field['field_name']}' value='{$term->slug}'{$checked} /> {$term->name}</label>";
}
$html = implode('<br />', $html);
} elseif ('checkbox_tree' === $options['type']) {
$elements = self::process_terms($terms);
$html .= self::walk_checkbox_tree($meta, $field, $elements, $field['options']['parent'], true);
} elseif ('select_tree' == $options['type']) {
$elements = self::process_terms($terms);
$html .= self::walk_select_tree($meta, $field, $elements, $field['options']['parent'], '', true);
} else {
$multiple = $field['multiple'] ? " multiple='multiple' style='height: auto;'" : "'";
$html .= "<select name='{$field['field_name']}'{$multiple}>";
foreach ($terms as $term) {
$selected = selected(in_array($term->slug, $meta), true, false);
$html .= "<option value='{$term->slug}'{$selected}>{$term->name}</option>";
}
$html .= "</select>";
}
return $html;
}
开发者ID:nWidart,项目名称:meta-box,代码行数:39,代码来源:field-taxonomy.php
示例2: jellythemes_photos_list
function jellythemes_photos_list($atts, $content = null)
{
extract(shortcode_atts(array('limit' => 8), $atts));
$return = '
<nav class="primary"><ul>
<li><a class="selected" href="#" data-filter="*"><span>' . __('All photos', 'jellythemes') . '</span></a></li>';
$types = get_terms('type', array('hide_empty' => 0));
if ($types && !is_wp_error($types)) {
foreach ($types as $type) {
$return .= '<li><a href="#" data-filter=".' . esc_js($type->slug) . '"><span>' . $type->name . '</span></a></li>';
}
}
$return .= '</ul></nav>
<div class="portfolio">';
$photos = new WP_Query(array('post_type' => 'photo', 'posts_per_page' => esc_attr($limit)));
while ($photos->have_posts()) {
$photos->the_post();
$term_list = wp_get_post_terms(get_the_ID(), 'type', array("fields" => "names"));
$images = rwmb_meta('_jellythemes_project_images', 'type=plupload_image', get_the_ID());
foreach ($images as $image) {
$img = wp_get_attachment_image($image['ID'], 'full', false, array('class' => 'img-responsive'));
$src = wp_get_attachment_image_src($image['ID'], 'full');
}
$return .= '<article class="' . implode(' ', get_post_class('entry')) . '">
<a class="swipebox" href="' . $src[0] . '">
' . $img . '
<span class="magnifier"></span>
</a>
</article>';
}
$return .= '</div>';
return $return;
}
开发者ID:foresitegroup,项目名称:mortons,代码行数:33,代码来源:functions.shortcodes.php
示例3: get_values
protected function get_values()
{
$terms = array();
// Load all available event categories
$source = get_terms(TribeEvents::TAXONOMY, array('orderby' => 'name', 'order' => 'ASC'));
if (empty($source) || is_wp_error($source)) {
return array();
}
// Preprocess the terms
foreach ($source as $term) {
$terms[(int) $term->term_id] = $term;
$term->parent = (int) $term->parent;
$term->depth = 0;
$term->children = array();
}
// Initally copy the source list of terms to our ordered list
$ordered_terms = $terms;
// Re-order!
foreach ($terms as $id => $term) {
// Skip root elements
if (0 === $term->parent) {
continue;
}
// Reposition child terms within the ordered terms list
unset($ordered_terms[$id]);
$term->depth = $terms[$term->parent]->depth + 1;
$terms[$term->parent]->children[$id] = $term;
}
// Finally flatten out and return
return $this->flattened_term_list($ordered_terms);
}
开发者ID:TMBR,项目名称:johnjohn,代码行数:31,代码来源:TribeEventsFilter_Category.php
示例4: sf_ajax_optionsearch
function sf_ajax_optionsearch()
{
$data = array();
$i = 0;
preg_match_all('^(.*)\\[(.*)\\]^', $_POST['val'], $match);
$data_type = $match[1][0];
$data_value = $match[2][0];
if ($data_type == 'meta') {
$terms = get_postmeta_values($data_value);
if (is_array($terms)) {
foreach ($terms as $term) {
$data[$i]['key'] = $term->meta_value;
$data[$i]['val'] = $term->meta_value;
$i++;
}
}
} elseif ($data_type == 'tax') {
$args = array('orderby' => 'name', 'order' => 'ASC', 'hide_empty' => true);
$terms = get_terms($data_value, $args);
if (is_array($terms)) {
foreach ($terms as $term) {
$data[$i]['key'] = $term->term_id;
$data[$i]['val'] = $term->name;
$i++;
}
}
}
echo json_encode($data);
die;
}
开发者ID:Juni4567,项目名称:meritscholarship,代码行数:30,代码来源:ajax.php
示例5: hmp_category_meta_box
function hmp_category_meta_box($post)
{
global $post;
?>
<p><label for="hmp_portfolio_category">Category</label></p>
<select name="hmp_portfolio_category">
<option value="">Select Category...</option>
<?php
$cats = get_terms('hmp-entry-category', array('hide_empty' => false));
$obj_cat = wp_get_object_terms($post->ID, 'hmp-entry-category');
$obj_cat = $obj_cat[0];
foreach ($cats as $cat) {
?>
<option <?php
if ($cat->term_id == $obj_cat->term_id) {
echo 'selected="selected" ';
}
?>
value="<?php
echo $cat->term_id;
?>
"><?php
echo $cat->name;
?>
</option>
<?php
}
?>
</select>
<p><label for="hmp_portfolio_new_category">Add New Category</label></p>
<input name="hmp_portfolio_new_category" type="text" />
<?php
}
开发者ID:humanmade,项目名称:HM-Portfolio,代码行数:33,代码来源:meta-boxes.php
示例6: uni_calendar_display_categories
function uni_calendar_display_categories()
{
?>
<div class="pagePanel clear">
<?php
$aEventCats = get_terms('uni_calendar_event_cat');
if (!empty($aEventCats) && !is_wp_error($aEventCats)) {
?>
<ul class="productFilter classesFilter clear">
<li><a class="active" data-filter="all" href="#"><?php
_e('All', 'uni-calendar');
?>
</a></li>
<?php
foreach ($aEventCats as $oTerm) {
?>
<li><a data-filter="<?php
echo $oTerm->slug;
?>
" href="#"><?php
echo $oTerm->name;
?>
</a></li>
<?php
}
?>
</ul>
<?php
}
?>
</div>
<?php
}
开发者ID:primus1989,项目名称:https---github.com-DataDesignSystems-drishtiq,代码行数:33,代码来源:uni-events-calendar-functions.php
示例7: _get_html_for_taxonomy
/**
* Generates the HTML for a taxonomy selector.
*
* @param array $view_args Arguments to the parent view
* @param bool $tag whether it's tags or categories.
*
* @return string Markup for categories selector
*/
protected function _get_html_for_taxonomy($view_args, $tag = false)
{
$taxonomy_name = 'events_categories';
$type = 'category';
$type_for_filter = 'cat_ids';
$type_for_view_args = 'categories';
if (true === $tag) {
$taxonomy_name = 'events_tags';
$type = 'tag';
$type_for_filter = 'tag_ids';
$type_for_view_args = 'tags';
}
$terms = get_terms($taxonomy_name, array('orderby' => 'name'));
if (empty($terms)) {
return '';
}
foreach ($terms as &$term) {
$href = $this->_registry->get('html.element.href', $view_args, $type);
$href->set_term_id($term->term_id);
$term->href = $href->generate_href();
if (false === $tag) {
$taxonomy = $this->_registry->get('view.event.taxonomy');
$term->color = $taxonomy->get_category_color_square($term->term_id);
}
}
$href_for_clearing_filter = $this->generate_href_without_arguments($view_args, array($type_for_filter));
$args = array($type_for_view_args => $terms, 'selected_' . $type_for_filter => $view_args[$type_for_filter], 'data_type' => $view_args['data_type'], 'clear_filter' => $href_for_clearing_filter, 'text_clear_category_filter' => __('Clear category filter', AI1EC_PLUGIN_NAME), 'text_categories' => __('Categories', AI1EC_PLUGIN_NAME), 'text_clear_tag_filter' => __('Clear tag filter', AI1EC_PLUGIN_NAME), 'text_tags' => __('Tags', AI1EC_PLUGIN_NAME));
$loader = $this->_registry->get('theme.loader');
return $loader->get_file($type_for_view_args . '.twig', $args, false)->get_content();
}
开发者ID:sedici,项目名称:wpmu-istec,代码行数:38,代码来源:taxonomy.php
示例8: get_shows
public function get_shows($hide_empty = true)
{
$args = array('orderby' => 'name', 'order' => 'ASC', 'hide_empty' => $hide_empty, 'cache_domain' => 'core');
$podcast_show_slug = dipo_get_podcast_show_slug();
$podcast_show = get_terms($podcast_show_slug, $args);
return isset($podcast_show) ? $podcast_show : null;
}
开发者ID:ICFMovement,项目名称:dicentis,代码行数:7,代码来源:class-dipo-podcast-shows-model.php
示例9: smamo_widgets_init
function smamo_widgets_init()
{
$terms = get_terms('tax_widget', array('orderby' => 'id', 'hide_empty' => false));
foreach ($terms as $widget) {
register_sidebar(array('id' => $widget->slug, 'name' => $widget->name, 'description' => $widget->description, 'before_widget' => '<div class="widget">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
}
}
开发者ID:JeppeSigaard,项目名称:4smaritime,代码行数:7,代码来源:register-widget-areas.php
示例10: cleanup
public function cleanup($opt = NULL, $cpt = NULL, $tax = NULL)
{
// Perform security checks.
if (self::authorize() == TRUE) {
// Remove plugin options from wp_options database table.
if ($opt) {
foreach ($opt as $option) {
delete_option($option);
}
}
// Remove plugin-specific custom post type entries.
if ($cpt) {
$entries = get_posts(array('post_type' => $cpt, 'numberposts' => -1));
foreach ($entries as $entry) {
wp_delete_post($entry->ID, TRUE);
}
}
// Remove plugin-specific custom taxonomy terms.
if ($tax) {
global $wp_taxonomies;
foreach ($tax as $taxonomy) {
register_taxonomy($taxonomy['taxonomy'], $taxonomy['object_type']);
$terms = get_terms($taxonomy['taxonomy'], array('hide_empty' => 0));
foreach ($terms as $term) {
wp_delete_term($term->term_id, $taxonomy['taxonomy']);
}
delete_option($taxonomy['taxonomy'] . '_children');
unset($wp_taxonomies[$taxonomy['taxonomy']]);
}
}
}
}
开发者ID:runinout,项目名称:wppizza,代码行数:32,代码来源:admin.plugin.uninstall.janitor.php
示例11: get_category_list
function get_category_list()
{
$terms = get_terms('category', 'orderby=name&hide_empty=0');
// 获取到的分类数量
$count = count($terms);
$data = array();
if ($count > 0) {
// 循环输出所有分类信息
foreach ($terms as $term) {
$term_array = get_object_vars($term);
// ["term_id"]=> string(1) "7"
// ["name"]=> string(7) "ASP.NET"
// ["slug"]=> string(6) "aspnet"
// ["term_group"]=> string(1) "0"
// ["term_taxonomy_id"]=> string(1) "7"
// ["taxonomy"]=> string(8) "category"
// ["description"]=> string(0) ""
//["parent"]=> string(1) "4"
// ["count"]=> string(1) "1" }
// echo '<li><a href="'.get_term_link($term, $term->slug).'" title="'.$term->name.'">'.$term->name.'</a></li>';
$array = array('text' => $term_array['name'], 'id' => $term_array['term_id'], 'count' => $term_array['count'], 'description' => $term_array['description'], 'iconCls' => 'x-fa fa-inbox', 'leaf' => true);
// if (!$is_leaf) {
// $array =array_merge($array, $NextAgent);
// }
array_push($data, $array);
}
}
$res = new Response();
$res->success = true;
$res->message = '';
$res->data = $data;
echo $res->to_json();
}
开发者ID:sqlwang,项目名称:my_wpblog,代码行数:33,代码来源:functions.php
示例12: woocommerce_product_categories
/**
* List all (or limited) product categories
**/
function woocommerce_product_categories($atts)
{
global $woocommerce_loop;
extract(shortcode_atts(array('number' => null, 'orderby' => 'name', 'order' => 'ASC', 'columns' => '4', 'hide_empty' => 1), $atts));
if (isset($atts['ids'])) {
$ids = explode(',', $atts['ids']);
$ids = array_map('trim', $ids);
} else {
$ids = array();
}
$hide_empty = $hide_empty == true || $hide_empty == 1 ? 1 : 0;
$args = array('number' => $number, 'orderby' => $orderby, 'order' => $order, 'hide_empty' => $hide_empty, 'include' => $ids);
$terms = get_terms('product_cat', $args);
$woocommerce_loop['columns'] = $columns;
ob_start();
if ($product_categories) {
echo '<ul class="products">';
foreach ($product_categories as $category) {
woocommerce_get_template('content-product_cat.php', array('category' => $category));
}
echo '</ul>';
}
wp_reset_query();
return ob_get_clean();
}
开发者ID:eddiewilson,项目名称:new-ke,代码行数:28,代码来源:shortcode-init.php
示例13: gdlr_add_import_action
function gdlr_add_import_action()
{
// setting > reading area
update_option('show_on_front', 'page');
update_option('page_on_front', 3720);
update_option('page_for_posts', 0);
// style-custom file
if ($_POST['import-file'] == 'demo.xml') {
$default_file = GDLR_LOCAL_PATH . '/include/function/gdlr-admin-default.txt';
$default_admin_option = unserialize(file_get_contents($default_file));
update_option(THEME_SHORT_NAME . '_admin_option', $default_admin_option);
$source = get_template_directory() . '/stylesheet/style-custom-light.css';
$destination = get_template_directory() . '/stylesheet/style-custom.css';
copy($source, $destination);
} else {
if ($_POST['import-file'] == 'demo-dark.xml') {
$default_file = GDLR_LOCAL_PATH . '/include/function/gdlr-admin-default-dark.txt';
$default_admin_option = unserialize(file_get_contents($default_file));
update_option(THEME_SHORT_NAME . '_admin_option', $default_admin_option);
$source = get_template_directory() . '/stylesheet/style-custom-dark.css';
$destination = get_template_directory() . '/stylesheet/style-custom.css';
copy($source, $destination);
} else {
if ($_POST['import-file'] == 'demo-modern.xml') {
$default_file = GDLR_LOCAL_PATH . '/include/function/gdlr-admin-default-modern.txt';
$default_admin_option = unserialize(file_get_contents($default_file));
update_option(THEME_SHORT_NAME . '_admin_option', $default_admin_option);
$source = get_template_directory() . '/stylesheet/style-custom-modern.css';
$destination = get_template_directory() . '/stylesheet/style-custom.css';
copy($source, $destination);
} else {
if ($_POST['import-file'] == 'demo-hostel.xml') {
$default_file = GDLR_LOCAL_PATH . '/include/function/gdlr-admin-default-hostel.txt';
$default_admin_option = unserialize(file_get_contents($default_file));
update_option(THEME_SHORT_NAME . '_admin_option', $default_admin_option);
$source = get_template_directory() . '/stylesheet/style-custom-hostel.css';
$destination = get_template_directory() . '/stylesheet/style-custom.css';
copy($source, $destination);
}
}
}
}
// menu to themes location
$nav_id = 0;
$navs = get_terms('nav_menu', array('hide_empty' => true));
foreach ($navs as $nav) {
if ($nav->name == 'Main menu') {
$nav_id = $nav->term_id;
break;
}
}
set_theme_mod('nav_menu_locations', array('main_menu' => $nav_id));
// import the widget
$widget_file = GDLR_LOCAL_PATH . '/plugins/goodlayers-importer-widget.txt';
$widget_data = unserialize(file_get_contents($widget_file));
// retrieve widget data
foreach ($widget_data as $key => $value) {
update_option($key, $value);
}
}
开发者ID:hoa32811,项目名称:wp_thanhtrung_hotel,代码行数:60,代码来源:goodlayers-importer.php
示例14: vbegy_register_meta_boxes
function vbegy_register_meta_boxes()
{
global $prefix;
if (!class_exists('RW_Meta_Box')) {
return;
}
$options_categories = array();
$options_categories_obj = get_categories();
foreach ($options_categories_obj as $category) {
$options_categories[$category->cat_ID] = $category->cat_name;
}
$sidebars = get_option('sidebars');
$new_sidebars = array('default' => 'Default');
foreach ($GLOBALS['wp_registered_sidebars'] as $sidebar) {
$new_sidebars[$sidebar['id']] = $sidebar['name'];
}
// Menus
$menus = array();
$all_menus = get_terms('nav_menu', array('hide_empty' => true));
foreach ($all_menus as $menu) {
$menus[$menu->term_id] = $menu->name;
}
$meta_boxes = array();
$post_types = get_post_types();
$meta_boxes[] = array('id' => 'blog', 'title' => 'Blog Options', 'pages' => array('page'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => "Post number", 'desc' => "put the post number", 'id' => $prefix . 'post_number_b', 'type' => 'text', 'std' => "5"), array('name' => "Order by", 'desc' => "Select the post order by .", 'id' => $prefix . "orderby_post_b", 'std' => array("recent"), 'type' => "select", 'options' => array('recent' => 'Recent', 'popular' => 'Popular', 'random' => 'Random')), array('name' => "Display by", 'id' => $prefix . "post_display_b", 'type' => 'select', 'options' => array('lasts' => 'Lasts', 'single_category' => 'Single category', 'multiple_categories' => 'Multiple categories', 'posts' => 'Custom posts'), 'std' => array('lasts')), array('name' => 'Single category', 'id' => $prefix . 'post_single_category_b', 'type' => 'select', 'options' => $options_categories), array('name' => "Post categories", 'desc' => "Select the post categories .", 'id' => $prefix . "post_categories_b", 'options' => $options_categories, 'type' => 'checkbox_list'), array('name' => "Post ids", 'desc' => "Type the post ids .", 'id' => $prefix . "post_posts_b", 'std' => '', 'type' => 'text')));
$meta_boxes[] = array('id' => 'contact_us', 'title' => 'Contact us Options', 'pages' => array('page'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => 'Map', 'desc' => 'Put the code iframe map .', 'id' => $prefix . 'contact_map', 'std' => '<iframe height="400" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?q=egypt&hl=en&sll=26.820553,30.802498&sspn=16.874794,19.753418&hnear=Egypt&t=m&z=6&output=embed"></iframe>', 'type' => 'textarea'), array('name' => 'Form shortcode', 'desc' => 'Put the form shortcode .', 'id' => $prefix . 'contact_form', 'type' => 'text'), array('name' => 'About widget enable or disable', 'desc' => 'About widget enable or disable .', 'id' => $prefix . 'about_widget', 'std' => 1, 'type' => 'checkbox'), array('name' => 'About content', 'desc' => 'Put the about content .', 'id' => $prefix . 'about_content', 'type' => 'textarea'), array('name' => 'Address', 'desc' => 'Put the address .', 'id' => $prefix . 'address', 'type' => 'text'), array('name' => 'Phone', 'desc' => 'Put the phone .', 'id' => $prefix . 'phone', 'type' => 'text'), array('name' => 'Email', 'desc' => 'Put the email .', 'id' => $prefix . 'email', 'type' => 'text'), array('name' => 'Social enable or disable', 'desc' => 'Social widget enable or disable .', 'id' => $prefix . 'social', 'std' => 1, 'type' => 'checkbox'), array('name' => 'Facebook', 'desc' => 'Put the facebook .', 'id' => $prefix . 'facebook', 'type' => 'text'), array('name' => 'Twitter', 'desc' => 'Put the twitter .', 'id' => $prefix . 'twitter', 'type' => 'text'), array('name' => 'Youtube', 'desc' => 'Put the youtube .', 'id' => $prefix . 'youtube', 'type' => 'text'), array('name' => 'Linkedin', 'desc' => 'Put the linkedin .', 'id' => $prefix . 'linkedin', 'type' => 'text'), array('name' => 'Google plus', 'desc' => 'Put the google plus .', 'id' => $prefix . 'google_plus', 'type' => 'text'), array('name' => 'Instagram', 'desc' => 'Put the instagram .', 'id' => $prefix . 'instagram', 'type' => 'text'), array('name' => 'Dribbble', 'desc' => 'Put the dribbble .', 'id' => $prefix . 'dribbble', 'type' => 'text'), array('name' => 'Pinterest', 'desc' => 'Put the pinterest .', 'id' => $prefix . 'pinterest', 'type' => 'text'), array('name' => 'Rss enable or disable', 'desc' => 'Rss widget enable or disable .', 'id' => $prefix . 'rss', 'std' => 1, 'type' => 'checkbox')));
$meta_boxes[] = array('id' => 'ask_me', 'title' => 'Home Options', 'pages' => array('page'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => 'Home top box enable or disable', 'desc' => 'Home top box enable or disable .', 'id' => $prefix . 'index_top_box', 'std' => 1, 'type' => 'checkbox'), array('name' => 'Home top box layout', 'desc' => 'Home top box layout .', 'id' => $prefix . 'index_top_box_layout', 'std' => '1', 'class' => 'index_top_box_layout', 'type' => 'radio', 'options' => array("1" => "Style 1", "2" => "Style 2")), array('name' => 'Remove the content ?', 'desc' => 'Remove the content ( Title, content, buttons and ask question ) ?', 'id' => $prefix . 'remove_index_content', 'type' => 'checkbox'), array('name' => 'Home top box background', 'desc' => 'Home top box background .', 'id' => $prefix . 'index_top_box_background', 'std' => 'background', 'class' => 'index_top_box_background', 'type' => 'radio', 'options' => array("background" => "Background", "slideshow" => "Slideshow")), array('name' => 'Upload your images', 'id' => $prefix . "upload_images_home", 'type' => 'image_advanced'), array('name' => "Background color", 'id' => $prefix . "background_color_home", 'type' => 'color'), array('name' => 'Background', 'id' => $prefix . "background_img_home", 'type' => 'upload'), array('name' => "Background repeat", 'id' => $prefix . "background_repeat_home", 'type' => 'select', 'options' => array('repeat' => 'repeat', 'no-repeat' => 'no-repeat', 'repeat-x' => 'repeat-x', 'repeat-y' => 'repeat-y')), array('name' => "Background fixed", 'id' => $prefix . "background_fixed_home", 'type' => 'select', 'options' => array('fixed' => 'fixed', 'scroll' => 'scroll')), array('name' => "Background position x", 'id' => $prefix . "background_position_x_home", 'type' => 'select', 'options' => array('left' => 'left', 'center' => 'center', 'right' => 'right')), array('name' => "Background position y", 'id' => $prefix . "background_position_y_home", 'type' => 'select', 'options' => array('top' => 'top', 'center' => 'center', 'bottom' => 'bottom')), array('name' => "Full Screen Background", 'id' => $prefix . "background_full_home", 'type' => 'checkbox', 'std' => 0), array('name' => 'Home top box title', 'desc' => 'Put the Home top box title .', 'id' => $prefix . 'index_title', 'std' => 'Welcome to Ask me', 'type' => 'text'), array('name' => 'Home top box content', 'desc' => 'Put the Home top box content .', 'id' => $prefix . 'index_content', 'std' => 'Duis dapibus aliquam mi, eget euismod sem scelerisque ut. Vivamus at elit quis urna adipiscing iaculis. Curabitur vitae velit in neque dictum blandit. Proin in iaculis neque.', 'type' => 'textarea'), array('name' => 'About Us title', 'desc' => 'Put the About Us title .', 'id' => $prefix . 'index_about', 'std' => 'About Us', 'type' => 'text'), array('name' => 'About Us link', 'desc' => 'Put the About Us link .', 'id' => $prefix . 'index_about_h', 'std' => '#', 'type' => 'text'), array('name' => 'Join Now title', 'desc' => 'Put the Join Now title .', 'id' => $prefix . 'index_join', 'std' => 'Join Now', 'type' => 'text'), array('name' => 'Join Now link', 'desc' => 'Put the Join Now link .', 'id' => $prefix . 'index_join_h', 'std' => '#', 'type' => 'text'), array('name' => 'About Us title if login', 'desc' => 'Put the About Us title if login .', 'id' => $prefix . 'index_about_login', 'std' => 'About Us', 'type' => 'text'), array('name' => 'About Us link if login', 'desc' => 'Put the About Us link if login .', 'id' => $prefix . 'index_about_h_login', 'std' => '#', 'type' => 'text'), array('name' => 'Ask question title if login', 'desc' => 'Put the Ask question title if login .', 'id' => $prefix . 'index_join_login', 'std' => 'Ask question', 'type' => 'text'), array('name' => 'Ask question link if login', 'desc' => 'Put the Ask question link if login .', 'id' => $prefix . 'index_join_h_login', 'std' => '#', 'type' => 'text'), array('name' => "Page style", 'id' => $prefix . "index_tabs", 'type' => 'select', 'options' => array(1 => "Tabs", 2 => 'Recent questions', 3 => 'Page content')), array('name' => 'Tabs pagination enable or disable', 'desc' => 'Tabs pagination enable or disable .', 'id' => $prefix . 'pagination_tabs', 'std' => 1, 'type' => 'checkbox'), array('name' => 'Choose your tabs', 'id' => $prefix . 'what_tab', 'options' => array("recent_questions" => "Recent Questions", "most_responses" => "Most Responses / answers", "recently_answered" => "Recently Answered", "no_answers" => "No answers", "most_visit" => "Most Visit", "most_vote" => "Most Vote", "recent_posts" => "Recent Posts"), 'std' => array("recent_questions", "most_responses", "recently_answered", "no_answers"), 'type' => 'checkbox_list'), array('name' => 'Posts per page', 'desc' => 'Put the Posts per page .', 'id' => $prefix . 'posts_per_page', 'std' => '10', 'type' => 'text')));
$meta_boxes[] = array('id' => 'post_page', 'title' => 'Post and Page Options', 'pages' => array('post', 'page', 'question', 'product'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => 'Layout', 'id' => $prefix . "layout", 'class' => 'radio_no_margin', 'type' => 'radio', 'options' => array('default' => '', 'full' => '', 'fixed' => '', 'fixed_2' => ''), 'std' => 'default'), array('name' => 'Choose page / post template', 'id' => $prefix . "home_template", 'class' => 'radio_no_margin', 'type' => 'radio', 'options' => array('default' => '', 'grid_1200' => '', 'grid_970' => ''), 'std' => 'default'), array('name' => 'Choose page / post skin', 'id' => $prefix . "site_skin_l", 'class' => 'radio_no_margin', 'type' => 'radio', 'options' => array('default' => '', 'site_light' => '', 'site_dark' => ''), 'std' => 'default'), array('name' => 'Choose Your Skin', 'id' => $prefix . "skin", 'class' => 'radio_no_margin', 'type' => 'radio', 'options' => array('default' => '', 'skin' => '', 'blue' => '', 'gray' => '', 'green' => '', 'moderate_cyan' => '', 'orange' => '', 'purple' => '', 'red' => '', 'strong_cyan' => '', 'yellow' => ''), 'std' => 'default'), array('name' => 'Primary Color', 'id' => $prefix . "primary_color", 'type' => 'color'), array('name' => 'Secondary Color', 'id' => $prefix . "secondary_color", 'type' => 'color'), array('name' => 'Background', 'id' => $prefix . "background_img", 'type' => 'upload'), array('name' => "Background color", 'id' => $prefix . "background_color", 'type' => 'color'), array('name' => "Background repeat", 'id' => $prefix . "background_repeat", 'type' => 'select', 'options' => array('repeat' => 'repeat', 'no-repeat' => 'no-repeat', 'repeat-x' => 'repeat-x', 'repeat-y' => 'repeat-y')), array('name' => "Background fixed", 'id' => $prefix . "background_fixed", 'type' => 'select', 'options' => array('fixed' => 'fixed', 'scroll' => 'scroll')), array('name' => "Background position x", 'id' => $prefix . "background_position_x", 'type' => 'select', 'options' => array('left' => 'left', 'center' => 'center', 'right' => 'right')), array('name' => "Background position y", 'id' => $prefix . "background_position_y", 'type' => 'select', 'options' => array('top' => 'top', 'center' => 'center', 'bottom' => 'bottom')), array('name' => "Full Screen Background", 'id' => $prefix . "background_full", 'type' => 'checkbox', 'std' => 0), array('name' => 'Sidebar', 'id' => $prefix . "sidebar", 'class' => 'radio_no_margin', 'type' => 'radio', 'options' => array('default' => '', 'right' => '', 'full' => '', 'left' => ''), 'std' => 'default'), array('name' => 'Select your sidebar', 'id' => $prefix . 'what_sidebar', 'type' => 'select', 'options' => $new_sidebars), array('name' => 'Head post', 'id' => $prefix . 'what_post', 'type' => 'select', 'options' => array('image' => "Featured Image", 'google' => "Google Map", 'slideshow' => "Slideshow", 'video' => "Video"), 'std' => array('image'), 'desc' => 'Choose from here the post type .'), array('name' => 'Google map', 'desc' => "Put your google map html", 'id' => $prefix . "google", 'type' => 'textarea', 'cols' => "40", 'rows' => "8"), array('name' => 'Slideshow ?', 'id' => $prefix . 'slideshow_type', 'type' => 'select', 'options' => array('custom_slide' => "Custom Slideshow", 'upload_images' => "Upload your images"), 'std' => array('custom_slide')), array('id' => $prefix . 'slideshow_post', 'type' => 'note'), array('name' => 'Upload your images', 'id' => $prefix . "upload_images", 'type' => 'image_advanced'), array('name' => 'Video type', 'id' => $prefix . 'video_post_type', 'type' => 'select', 'options' => array('youtube' => "Youtube", 'vimeo' => "Vimeo", 'daily' => "Dialymotion", 'html5' => "HTML 5"), 'std' => array('youtube'), 'desc' => 'Choose from here the video type'), array('name' => 'Video ID', 'id' => $prefix . 'video_post_id', 'desc' => 'Put here the video id : http://www.youtube.com/watch?v=sdUUx5FdySs EX : "sdUUx5FdySs"', 'type' => 'text', 'std' => ''), array('name' => 'Video Image', 'desc' => 'Upload a image, or enter URL to an image if it is already uploaded. ', 'id' => $prefix . 'video_image', 'std' => '', 'type' => 'upload'), array('name' => 'Mp4 video', 'id' => $prefix . 'video_mp4', 'desc' => 'Put here the mp4 video', 'type' => 'text', 'std' => ''), array('name' => 'M4v video', 'id' => $prefix . 'video_m4v', 'desc' => 'Put here the m4v video', 'type' => 'text', 'std' => ''), array('name' => 'Webm video', 'id' => $prefix . 'video_webm', 'desc' => 'Put here the webm video', 'type' => 'text', 'std' => ''), array('name' => 'Ogv video', 'id' => $prefix . 'video_ogv', 'desc' => 'Put here the ogv video', 'type' => 'text', 'std' => ''), array('name' => 'Wmv video', 'id' => $prefix . 'video_wmv', 'desc' => 'Put here the wmv video', 'type' => 'text', 'std' => ''), array('name' => 'Flv video', 'id' => $prefix . 'video_flv', 'desc' => 'Put here the flv video', 'type' => 'text', 'std' => '')));
$meta_boxes[] = array('id' => 'single_page', 'title' => 'Single Pages Options', 'pages' => array('post', 'page', 'question', 'product'), 'context' => 'side', 'priority' => 'default', 'fields' => array(array('name' => 'Choose a custom page setting', 'desc' => 'Choose a custom page setting .', 'id' => $prefix . 'custom_page_setting', 'type' => 'checkbox'), array('name' => 'Sticky sidebar enable or disable', 'desc' => 'Sticky sidebar enable or disable .', 'id' => $prefix . 'sticky_sidebar_s', 'std' => 'on', 'type' => 'checkbox'), array('name' => 'Post meta enable or disable', 'desc' => 'Post meta enable or disable .', 'id' => $prefix . 'post_meta_s', 'std' => 'on', 'type' => 'checkbox'), array('name' => 'Share enable or disable', 'desc' => 'Share enable or disable .', 'id' => $prefix . 'post_share_s', 'std' => 'on', 'type' => 'checkbox'), array('name' => 'Author info box enable or disable', 'desc' => 'Author info box enable or disable .', 'id' => $prefix . 'post_author_box_s', 'std' => 'on', 'type' => 'checkbox'), array('name' => 'Related post enable or disable', 'desc' => 'Related post enable or disable .', 'id' => $prefix . 'related_post_s', 'std' => 'on', 'type' => 'checkbox'), array('name' => 'Comments enable or disable', 'desc' => 'Comments enable or disable .', 'id' => $prefix . 'post_comments_s', 'std' => 'on', 'type' => 'checkbox'), array('name' => 'Navigation post enable or disable', 'desc' => 'Navigation post ( next and previous posts) enable or disable .', 'id' => $prefix . 'post_navigation_s', 'std' => 'on', 'type' => 'checkbox')));
$meta_boxes[] = array('id' => 'advertising', 'title' => 'Advertising Options', 'pages' => array('post', 'page', 'question', 'product'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => "Advertising after header", 'id' => $prefix . 'header_adv_n', 'type' => 'heading'), array('name' => 'Advertising type', 'desc' => 'Advertising type .', 'id' => $prefix . 'header_adv_type', 'std' => 'custom_image', 'type' => 'radio', 'class' => 'radio', 'options' => array("display_code" => "Display code", "custom_image" => "Custom Image")), array('name' => 'Image URL', 'desc' => 'Upload a image, or enter URL to an image if it is already uploaded. ', 'id' => $prefix . 'header_adv_img', 'std' => '', 'type' => 'upload'), array('name' => 'Advertising url', 'desc' => 'Advertising url. ', 'id' => $prefix . 'header_adv_href', 'std' => '#', 'type' => 'text'), array('name' => "Advertising Code html ( Ex: Google ads)", 'desc' => "Advertising Code html ( Ex: Google ads)", 'id' => $prefix . 'header_adv_code', 'std' => '', 'type' => 'textarea'), array('name' => "Advertising after share and tags ( in post and question )", 'id' => $prefix . 'share_adv_n', 'type' => 'heading'), array('name' => 'Advertising type', 'desc' => 'Advertising type .', 'id' => $prefix . 'share_adv_type', 'std' => 'custom_image', 'type' => 'radio', 'class' => 'radio', 'options' => array("display_code" => "Display code", "custom_image" => "Custom Image")), array('name' => 'Image URL', 'desc' => 'Upload a image, or enter URL to an image if it is already uploaded. ', 'id' => $prefix . 'share_adv_img', 'std' => '', 'type' => 'upload'), array('name' => 'Advertising url', 'desc' => 'Advertising url. ', 'id' => $prefix . 'share_adv_href', 'std' => '#', 'type' => 'text'), array('name' => "Advertising Code html ( Ex: Google ads)", 'desc' => "Advertising Code html ( Ex: Google ads)", 'id' => $prefix . 'share_adv_code', 'std' => '', 'type' => 'textarea'), array('name' => "Advertising after content", 'id' => $prefix . 'content_adv_n', 'type' => 'heading'), array('name' => 'Advertising type', 'desc' => 'Advertising type .', 'id' => $prefix . 'content_adv_type', 'std' => 'custom_image', 'type' => 'radio', 'class' => 'radio', 'options' => array("display_code" => "Display code", "custom_image" => "Custom Image")), array('name' => 'Image URL', 'desc' => 'Upload a image, or enter URL to an image if it is already uploaded. ', 'id' => $prefix . 'content_adv_img', 'std' => '', 'type' => 'upload'), array('name' => 'Advertising url', 'desc' => 'Advertising url. ', 'id' => $prefix . 'content_adv_href', 'std' => '#', 'type' => 'text'), array('name' => "Advertising Code html ( Ex: Google ads)", 'desc' => "Advertising Code html ( Ex: Google ads)", 'id' => $prefix . 'content_adv_code', 'std' => '', 'type' => 'textarea')));
foreach ($meta_boxes as $meta_box) {
new RW_Meta_Box($meta_box);
}
}
开发者ID:bunnywong,项目名称:freshlinker,代码行数:34,代码来源:meta_box.php
示例15: index_action
/**
* Displays the 'tagcloud' display type
*
* @param stdClass|C_Displayed_Gallery|C_DataMapper_Model $displayed_gallery
*/
function index_action($displayed_gallery, $return = FALSE)
{
$display_settings = $displayed_gallery->display_settings;
$application = $this->object->get_registry()->get_utility('I_Router')->get_routed_app();
$tag = $this->param('gallerytag');
// we're looking at a tag, so show images w/that tag as a thumbnail gallery
if (!is_home() && !empty($tag)) {
return $this->object->get_registry()->get_utility('I_Displayed_Gallery_Renderer')->display_images(array('source' => 'tags', 'container_ids' => array(esc_attr($tag)), 'display_type' => $display_settings['display_type'], 'original_display_type' => $displayed_gallery->display_type, 'original_settings' => $display_settings));
}
$defaults = array('exclude' => '', 'format' => 'list', 'include' => $displayed_gallery->get_term_ids_for_tags(), 'largest' => 22, 'link' => 'view', 'number' => $display_settings['number'], 'order' => 'ASC', 'orderby' => 'name', 'smallest' => 8, 'taxonomy' => 'ngg_tag', 'unit' => 'pt');
$args = wp_parse_args('', $defaults);
// Always query top tags
$tags = get_terms($args['taxonomy'], array_merge($args, array('orderby' => 'count', 'order' => 'DESC')));
foreach ($tags as $key => $tag) {
$tags[$key]->link = $this->object->set_param_for($application->get_routed_url(TRUE), 'gallerytag', $tag->slug);
$tags[$key]->id = $tag->term_id;
}
$params = $display_settings;
$params['inner_content'] = $displayed_gallery->inner_content;
$params['storage'] =& $storage;
$params['tagcloud'] = wp_generate_tag_cloud($tags, $args);
$params['displayed_gallery_id'] = $displayed_gallery->id();
$params = $this->object->prepare_display_parameters($displayed_gallery, $params);
return $this->object->render_partial('photocrati-nextgen_basic_tagcloud#nextgen_basic_tagcloud', $params, $return);
}
开发者ID:JeffreyBue,项目名称:jb,代码行数:30,代码来源:adapter.nextgen_basic_tagcloud_controller.php
示例16: search_terms
public static function search_terms($request = null)
{
$response = (object) array('status' =>
|
请发表评论