本文整理汇总了PHP中get_categories函数的典型用法代码示例。如果您正苦于以下问题:PHP get_categories函数的具体用法?PHP get_categories怎么用?PHP get_categories使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_categories函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getPicklistOptions
/**
*
* @return array;
*/
public function getPicklistOptions()
{
$tax_args = array('public' => true, '_builtin' => false);
$taxonomies = get_taxonomies($tax_args);
$taxonomies[] = 'category';
$args = array('type' => 'post', 'child_of' => 0, 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 1, 'hierarchical' => 1, 'taxonomy' => $taxonomies, 'pad_counts' => true);
$categories = get_categories($args);
$children = array();
if ($categories) {
foreach ($categories as $v) {
$v->title = $v->cat_name;
$v->parent_id = $v->category_parent;
$v->id = $v->cat_ID;
$pt = $v->category_parent;
$list = @$children[$pt] ? $children[$pt] : array();
array_push($list, $v);
$children[$pt] = $list;
}
}
//treecurse function from functions.php
$list = treerecurse($children);
$mitems = array();
foreach ($list as $item) {
$mitems[$item->id] = $item->treename;
}
return $mitems;
}
开发者ID:TeamCodeStudio,项目名称:fpmoz,代码行数:31,代码来源:CategoryPopulator.php
示例2: widget
function widget($args, $instance)
{
extract($args);
$warrior_category_list_title = apply_filters('widget_title', empty($instance['warrior_category_list_title']) ? esc_html__('Categories', 'newmagz') : $instance['warrior_category_list_title'], $instance, $this->id_base);
echo $before_widget;
echo '<div class="category-widget">';
echo $before_title . esc_attr($warrior_category_list_title) . $after_title;
echo '<div class="categories">';
echo '<ul>';
$taxonomy = 'category';
$a = 1;
$tax_terms = get_categories();
foreach ($tax_terms as $tax_term) {
echo '<li>';
echo '<div class="number">' . $a++ . '</div>';
echo '<div class="summary">';
echo '<a href="' . esc_url(get_term_link($tax_term, $taxonomy)) . '" title="' . sprintf(esc_html__("View all posts in %s", "newmagz"), $tax_term->name) . '" ' . '>' . $tax_term->name . '<small>' . $tax_term->category_count . esc_html__(' Articles', 'newmagz') . '</small></a>';
echo '</div>';
echo '</li>';
}
echo '</ul>';
echo '</div>';
echo '</div>';
echo $after_widget;
}
开发者ID:yeminhtut,项目名称:new_mag,代码行数:25,代码来源:warrior-list-category.php
示例3: form
function form($instance)
{
$defaults = array('pppage' => '10', 'filter' => 'all');
$instance = wp_parse_args($instance, $defaults);
extract($instance);
$args = array('orderby' => 'name', 'hide_empty' => 0, 'hierarchical' => 1, 'taxonomy' => 'client-category');
$filter_options = get_categories($args);
?>
<p class="description">
<label for="<?php
echo $this->get_field_id('pppage');
?>
">
Posts Per Page
<?php
echo aq_field_input('pppage', $block_id, $pppage, $size = 'full', $type = 'number');
?>
</label>
</p>
<p class="description">
<label for="<?php
echo $this->get_field_id('filter');
?>
">
Show Clients from a specific category?<br />
<?php
echo ebor_portfolio_field_select('filter', $block_id, $filter_options, $filter);
?>
</label>
</p>
<?php
}
开发者ID:misfist,项目名称:loom-theme,代码行数:35,代码来源:clients_block.php
示例4: noelie_product_categories
function noelie_product_categories()
{
if (is_woocommerce_activated()) {
global $woocommerce_loop;
$woosave_loop = $woocommerce_loop;
$woocommerce_loop['columns'] = 3;
ob_start();
$args = array('taxonomy' => 'product_cat', 'orderby' => 'name', 'show_count' => 0, 'pad_counts' => 0, 'hierarchical' => 1, 'title_li' => '', 'hide_empty' => 0);
$all_categories = get_categories($args);
$nbrr = count($all_categories);
echo '<section class="storefront-product-section storefront-product-categories">';
echo '<h2 class="section-title">' . __('Product Categories', 'storefront') . '</h2>';
?>
<div class="woocommerce columns-<?php
echo $woocommerce_loop['columns'];
?>
">
<ul class="products">
<?php
$nbr = 1;
foreach ($all_categories as $cat) {
if ($cat->category_parent == 0 && $nb < $woocommerce_loop['columns']) {
$category_id = $cat->term_id;
wc_get_template('content-product_cat.php', array('category' => $cat));
++$nb;
/*get_term_link($cat->slug, 'product_cat')*/
}
}
ob_get_contents();
$woocommerce_loop = $woosave_loop;
}
}
开发者ID:Nsy,项目名称:storefront_c,代码行数:32,代码来源:homepage_hook.php
示例5: render
function render($atts, $content = null)
{
parent::render($atts);
$buffy = '';
extract(shortcode_atts(array('limit' => '6', 'custom_title' => '', 'custom_url' => '', 'hide_title' => '', 'header_color' => ''), $atts));
$cat_args = array('show_count' => true, 'orderby' => 'count', 'hide_empty' => false, 'order' => 'DESC', 'number' => $limit + 1, 'exclude' => get_cat_ID(TD_FEATURED_CAT));
// exclude categories from the demo
if (TD_DEPLOY_MODE == 'demo' or TD_DEPLOY_MODE == 'dev') {
$cat_args['exclude'] = '44,45,46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 110, ' . get_cat_ID(TD_FEATURED_CAT);
}
$categories = get_categories($cat_args);
$buffy .= '<div class="td_block_wrap td_popular_categories widget widget_categories">';
$buffy .= $this->get_block_title();
if (!empty($categories)) {
$buffy .= '<ul class="td-pb-padding-side">';
foreach ($categories as $category) {
if (strtolower($category->cat_name) != 'uncategorized') {
$buffy .= '<li><a href="' . get_category_link($category->cat_ID) . '">' . $category->name . '<span class="td-cat-no">' . $category->count . '</span></a></li>';
}
}
$buffy .= '</ul>';
}
$buffy .= '</div> <!-- ./block -->';
return $buffy;
}
开发者ID:vikasjain1595,项目名称:wordpresstheme,代码行数:25,代码来源:td_popular_categories.php
示例6: 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
示例7: optionsframework_options
/**
* Defines an array of options that will be used to generate the settings page and be saved in the database.
* When creating the "id" fields, make sure to use all lowercase and no spaces.
*
*/
function optionsframework_options()
{
$themename = 'wp_get_theme' ? wp_get_theme() : wp_get_theme();
$themename = $themename['Name'];
$shortname = "of";
//Stylesheet Reader
$alt_stylesheets = array("black" => "black", "brown" => "brown", "blue" => "blue", "green" => "green", "pink" => "pink", "purple" => "purple", "red" => "red", "yellow" => "yellow");
// Test data
$test_array = array("one" => "One", "two" => "Two", "three" => "Three", "four" => "Four", "five" => "Five");
// Multicheck Array
$multicheck_array = array("one" => "French Toast", "two" => "Pancake", "three" => "Omelette", "four" => "Crepe", "five" => "Waffle");
// Multicheck Defaults
$multicheck_defaults = array("one" => "1", "five" => "1");
// Background Defaults
$background_defaults = array('color' => '', 'image' => '', 'repeat' => 'repeat', 'position' => 'top center', 'attachment' => 'scroll');
// Pull all the categories into an array
$options_categories = array();
$options_categories_obj = get_categories();
foreach ($options_categories_obj as $category) {
$options_categories[$category->cat_ID] = $category->cat_name;
}
// Pull all the pages into an array
$options_pages = array();
$options_pages_obj = get_pages('sort_column=post_parent,menu_order');
$options_pages[''] = 'Select a page:';
foreach ($options_pages_obj as $page) {
$options_pages[$page->ID] = $page->post_title;
}
// If using image radio buttons, define a directory path
$imagepath = get_stylesheet_directory_uri() . '/images/';
$options = array(array("name" => __("General Settings", "wrockmetro"), "type" => "heading"), array("name" => __("Custom Favicon URL", "wrockmetro"), "desc" => "Specify a 16px x 16px image that will represent your website's favicon.", "id" => "wrockmetro_favicon", "type" => "upload"), array("name" => __("Latest Posts", "wrockmetro"), "desc" => "Show 5 Latest Posts with Thumbnail in Sidebar.", "id" => "wrockmetro_activate_ltposts", "std" => "1", "type" => "checkbox"), array("name" => __("Show Author Profile", "wrockmetro"), "desc" => "Check the box to show Author Profile Below the Post.", "id" => "wrockmetro_author", "std" => "", "type" => "checkbox"), array("name" => __("Ads Management", "wrockmetro"), "type" => "heading"), array("name" => "Activate Ads Space Below Navigation", "desc" => "Activate Ads Space Below Navigation and put code in below test field.", "id" => "wrockmetro_banner", "std" => "", "type" => "checkbox"), array("name" => __("Ads code Below Main Navigation.", "wrockmetro"), "desc" => "Enter your ads code here, preferably a 728*15 link list unit, or a 728*90 lead-board ad.", "id" => "wrockmetro_banner_top", "std" => "", "type" => "textarea"), array("name" => __("AD Code For Single Post", "wrockmetro"), "desc" => "Path of the image to be displayed in sidebar section.", "id" => "wrockmetro_ad2", "std" => "", "type" => "textarea"), array("name" => __("AD Code For Footer", "wrockmetro"), "desc" => "Paste Ad Code for Footer Area below navigation.", "id" => "wrockmetro_ad1", "std" => "", "type" => "textarea"), $options[] = array("name" => __("Custom CSS", "wrockmetro"), "type" => "heading"), array("name" => __("Custom CSS", "wrockmetro"), "desc" => "Quickly add some CSS to your theme by adding it to this block.", "id" => "wrockmetro_customcss", "std" => "", "type" => "textarea"), array("name" => __("Social Media", "wrockmetro"), "type" => "heading"), array("name" => __("Show Social Follow ICONs", "wrockmetro"), "desc" => "Check the box to show social sites Follows buttons in Sidebar.", "id" => "wrockmetro_sharebut", "std" => "", "type" => "checkbox"), array("name" => __("Facebook URL", "wrockmetro"), "desc" => "Enter your Facebook URL if you have one", "id" => "wrockmetro_fb", "std" => "", "type" => "text"), array("name" => __("Twitter URL", "wrockmetro"), "desc" => "Enter your Twitter URL if you have one", "id" => "wrockmetro_tw", "std" => "", "type" => "text"), array("name" => __("RSS Feed URL", "wrockmetro"), "desc" => "Enter your RSS Feed URL if you have one", "id" => "wrockmetro_rss", "std" => "", "type" => "text"), array("name" => __("Google+ URL", "wrockmetro"), "desc" => "Enter your Google+ Link if you have one", "id" => "wrockmetro_gp", "std" => "", "type" => "text"), array("name" => __("Linked In URL", "wrockmetro"), "desc" => "Enter your Linkedin URL if you have one", "id" => "wrockmetro_in", "std" => "", "type" => "text"), array("name" => __("YouTube In URL", "wrockmetro"), "desc" => "Enter your YouTube URL if you have one", "id" => "wrockmetro_youtube", "std" => "", "type" => "text"), array("name" => __("Pinterest In URL", "wrockmetro"), "desc" => "Enter your Pinterest URL if you have one", "id" => "wrockmetro_pinterest", "std" => "", "type" => "text"), array("name" => __("Stumbleupon In URL", "wrockmetro"), "desc" => "Enter your Stumbleupon URL if you have one", "id" => "wrockmetro_stumbleupon", "std" => "", "type" => "text"), array("name" => __("Instagram In URL", "wrockmetro"), "desc" => "Enter your Instagram URL if you have one", "id" => "wrockmetro_instagram", "std" => "", "type" => "text"), array("name" => __("email In URL", "wrockmetro"), "desc" => "Enter your email URL if you have one", "id" => "wrockmetro_email", "std" => "", "type" => "text"));
update_option('of_themename', $themename);
return $options;
}
开发者ID:manishkhanchandani,项目名称:mkgxy,代码行数:39,代码来源:theme-options.php
示例8: smittenkitchen_filter_category_rewrite_rules
/**
* Remove the 'category' base from category URIs.
*/
function smittenkitchen_filter_category_rewrite_rules($rules)
{
$categories = get_categories(array('hide_empty' => false));
if (is_array($categories) && !empty($categories)) {
$slugs = array();
foreach ($categories as $category) {
if (is_object($category) && !is_wp_error($category)) {
if (0 == $category->category_parent) {
$slugs[] = $category->slug;
} else {
$slugs[] = trim(get_category_parents($category->term_id, false, '/', true), '/');
}
}
}
if (!empty($slugs)) {
$rules = array();
foreach ($slugs as $slug) {
$rules['(' . $slug . ')/feed/(feed|rdf|rss|rss2|atom)?/?$'] = 'index.php?category_name=$matches[1]&feed=$matches[2]';
$rules['(' . $slug . ')/(feed|rdf|rss|rss2|atom)/?$'] = 'index.php?category_name=$matches[1]&feed=$matches[2]';
$rules['(' . $slug . ')(/page/(\\d+))?/?$'] = 'index.php?category_name=$matches[1]&paged=$matches[3]';
}
}
}
return $rules;
}
开发者ID:a8cteam51,项目名称:smittenkitchen,代码行数:28,代码来源:vip-functions.php
示例9: tst_get_user_skills
function tst_get_user_skills($member_id)
{
global $ITV_USER_SKILLS_EXCLUDE_CATEGORIES;
$user_skills = get_user_meta($member_id, 'user_skills', true);
if (!is_array($user_skills)) {
$user_skills = $user_skills ? array($user_skills) : array();
}
$categories = get_categories(array('taxonomy' => 'category', 'hide_empty' => 0));
$categories_filtered = array();
$parent_categories = array();
foreach ($categories as $category) {
if (array_search($category->slug, $ITV_USER_SKILLS_EXCLUDE_CATEGORIES) === false) {
$category_hash = (array) $category;
$category_hash['checked'] = array_search($category->term_id, $user_skills) === false ? false : true;
if ($category->parent) {
$parent_categories[$category->parent] = 1;
}
$categories_filtered[] = $category_hash;
}
}
$categories = array();
foreach ($categories_filtered as $category) {
if (!isset($parent_categories[$category['term_id']])) {
$categories[] = $category;
}
}
usort($categories, function ($a, $b) {
return $a['parent'] > $b['parent'] ? -1 : 1;
});
return $categories;
}
开发者ID:rizomaa,项目名称:ITVolunteer,代码行数:31,代码来源:user_profile.php
示例10: getTags
/**
* get all tags
*
* @return array
*/
public static function getTags()
{
$taxonomy = 'post_tag';
$args = array('orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 0, 'hierarchical' => 0, 'taxonomy' => $taxonomy);
$tags = get_categories($args);
return $tags;
}
开发者ID:anjan011,项目名称:wp-query-generator,代码行数:12,代码来源:class.meAnjanWqg_Tags.php
示例11: venedor_page_get_postdata
function venedor_page_get_postdata()
{
global $page_meta_boxes, $wp_registered_sidebars;
// Page Meta Options
$theme_layouts = venedor_ct_layouts();
$theme_layouts = array_merge(array("widewidth" => "Wide Width"), $theme_layouts);
$sidebar_options = venedor_ct_sidebars();
$banner_type = venedor_ct_banner_type();
$banner_width = venedor_ct_banner_width();
$layer_sliders = venedor_ct_layer_sliders();
$rev_sliders = venedor_ct_rev_sliders();
$portfolio_columns = array("2" => "2 Columns", "3" => "3 Columns", "4" => "4 Columns");
$portfolio_cats = array();
$portfolio_cats[0] = 'All Categories';
$pcats = get_categories(array('taxonomy' => 'portfolio_cat'));
foreach ($pcats as $pcat) {
$portfolio_cats[$pcat->term_id] = $pcat->name;
}
$faq_cats = array();
$faq_cats[0] = 'All Categories';
$fcats = get_categories(array('taxonomy' => 'faq_cat'));
foreach ($fcats as $fcat) {
$faq_cats[$fcat->term_id] = $fcat->name;
}
// Page Meta Boxes
$page_meta_boxes = array("breadcrumbs" => venedor_labels_meta("breadcrumbs", "Breadcrumbs", "Disable breadcrumbs", "checkbox"), "title" => venedor_labels_meta("title", "Page Title", "Hide page title", "checkbox"), "layout" => venedor_labels_meta("layout", "Layout", "Select the layout.", "radio", "fullwidth", "radio", $theme_layouts), "sidebar" => venedor_labels_meta("sidebar", "Sidebar", "Select the sidebar you would like to display. <strong>Note</strong>: You must first create the sidebar under <strong>Appearance > Sidebars</strong>.", "customselect", "blog-sidebar", "", $sidebar_options), "header_on_banner" => venedor_labels_meta("header_on_banner", "Header on Banner", "Show header on banner. When select <strong>\"Banner Type\"</strong> to <strong>\"Layerslider\"</strong>, <strong>\"Revolution Slider\"</strong> or <strong>\"Banner\"</strong>, this option will be work.", "checkbox"), "bg_rev_slider" => venedor_labels_meta("bg_rev_slider", "Background Slider", "Select the Background Revolution Slider. If you should select <strong>\"Banner Type\"</strong> to <strong>\"Revolution Slider\"</strong>, this will be <strong>synchronize</strong> with <strong>banner revolution slider</strong>.", "customselect", "", "", $rev_sliders), "banner_type" => venedor_labels_meta("banner_type", "Banner Type", "Select the banner type which display above the page content.", "customselect", "", "", $banner_type), "banner_width" => venedor_labels_meta("banner_width", "Banner Width", "Select the banner width", "radio", "wide", "radio", $banner_width), "layer_slider" => venedor_labels_meta("layer_slider", "LayerSlider", "Select the LayerSlider.", "customselect", "", "", $layer_sliders), "rev_slider" => venedor_labels_meta("rev_slider", "Revolution Slider", "Select the Revolution Slider.", "customselect", "", "", $rev_sliders), "banner" => venedor_labels_meta("banner", "Banner", "", "textarea"), "product_slider" => venedor_labels_meta("product_slider", "Product Slider", "Comma separated list of product id.", "text"), "infinite_scroll" => venedor_labels_meta("infinite_scroll", "Infinite Scroll", "Enable infinite scroll. Use in <strong>Portfolio</strong> templates.", "checkbox"), "portfolio_columns" => venedor_labels_meta("portfolio_columns", "Portfolio Columns", "The number of the columns in the portfolio page. Use in <strong>Portfolio</strong> template.", "radio", "4", "radio", $portfolio_columns), "portfolio_cat" => venedor_labels_meta("portfolio_cat", "Portfolio Category", "Select the portfolio categories. Use in <strong>Portfolio</strong> template.", "multi_checkbox", "", "", $portfolio_cats), "portfolio_filters" => venedor_labels_meta("portfolio_filters", "Portfolio Filters", "Show the portfolio filters. Use in <strong>Portfolio</strong> template.", "checkbox"), "faq_cat" => venedor_labels_meta("faq_cat", "FAQ Category", "Select the faq categories. Use in <strong>FAQs</strong> template.", "multi_checkbox", "", "", $faq_cats), "faq_filters" => venedor_labels_meta("faq_filters", "FAQ Filters", "Show the faq filters. Use in <strong>FAQs</strong> template.", "checkbox"), "content_top" => venedor_labels_meta("content_top", "Content Top", "Input the content top block.", "text"), "content_bottom" => venedor_labels_meta("content_bottom", "Content Bottom", "Input the content bottom block.", "text"));
}
开发者ID:robwri32,项目名称:garland,代码行数:27,代码来源:page.php
示例12: get_filterby_terms
function get_filterby_terms()
{
$filtertype = $_POST['filtertype'];
$terms = array();
switch ($filtertype) {
case 'category':
$cats = get_categories();
foreach ($cats as $cat) {
$terms[$cat->term_id] = $cat->name;
}
break;
case 'tag':
$tags = get_tags();
foreach ($tags as $tag) {
$terms[$tag->slug] = $tag->name;
}
break;
case 'post_type':
$terms = $this->project_organizer->available_post_types();
break;
}
$terms = apply_filters('anth_get_posts_by', $terms, $filtertype);
print json_encode($terms);
die;
}
开发者ID:kosir,项目名称:thatcamp-org,代码行数:25,代码来源:class-ajax-handlers.php
示例13: zfwca_list_categories
|
请发表评论