本文整理汇总了PHP中wp_terms_checklist函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_terms_checklist函数的具体用法?PHP wp_terms_checklist怎么用?PHP wp_terms_checklist使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_terms_checklist函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: widget
/**
* widget function.
*
* @see WP_Widget
* @access public
* @param array $args
* @param array $instance
* @return void
*/
function widget($args, $instance)
{
if ($this->get_cached_widget($args)) {
return;
}
if (!class_exists('WP_Job_Manager_Job_Tags')) {
return;
}
global $job_manager, $post;
extract($args);
$title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
$icon = isset($instance['icon']) ? $instance['icon'] : null;
if ($icon) {
$before_title = sprintf($before_title, 'ion-' . $icon);
}
ob_start();
echo $before_widget;
if ($title) {
echo $before_title . $title . $after_title;
}
wp_terms_checklist($post->ID, array('taxonomy' => 'job_listing_tag', 'checked_ontop' => false, 'walker' => new Listify_Walker_Tags_Checklist()));
echo $after_widget;
$content = ob_get_clean();
echo apply_filters($this->widget_id, $content);
$this->cache_widget($args, $content);
}
开发者ID:GaryJones,项目名称:dockerfiles,代码行数:35,代码来源:class-widget-job_listing-tags.php
示例2: conditional_widgets_term_checkboxes
function conditional_widgets_term_checkboxes($tax, $type, $selected = array())
{
echo "<ul class='conditional-widget-selection-list'>";
$args = array('selected_cats' => $selected, 'checked_ontop' => false, 'taxonomy' => $tax, 'walker' => new Conditional_Widget_Walker_Category_Checklist($type, $tax));
wp_terms_checklist(0, $args);
echo "</ul>";
}
开发者ID:michael-cannon,项目名称:conditional-widgets,代码行数:7,代码来源:admin.php
示例3: add_attachment_fields_to_edit
static function add_attachment_fields_to_edit($form_fields, $post)
{
$terms = get_object_term_cache($post->ID, self::TAXONOMY);
$field = array();
$taxonomy_obj = (array) get_taxonomy(self::TAXONOMY);
if (!$taxonomy_obj['public'] || !$taxonomy_obj['show_ui']) {
continue;
}
if (false === $terms) {
$terms = wp_get_object_terms($post->ID, self::TAXONOMY);
}
$values = wp_list_pluck($terms, 'term_id');
ob_start();
wp_terms_checklist($post->ID, array('taxonomy' => self::TAXONOMY, 'checked_ontop' => false, 'walker' => new Walker_WP_Media_Taxonomy_Checklist($post->ID)));
$output = ob_get_clean();
if (!empty($output)) {
$output = '<ul class="term-list">' . $output . '</ul>';
$output .= wp_nonce_field('save_attachment_media_categories', 'media_category_nonce', false, false);
} else {
$output = '<ul class="term-list"><li>No ' . $taxonomy_obj['label'] . '</li></ul>';
}
$field = array('label' => !empty($taxonomy_obj['label']) ? $taxonomy_obj['label'] : self::TAXONOMY, 'value' => join(', ', $values), 'show_in_edit' => false, 'input' => 'html', 'html' => $output);
$form_fields[self::TAXONOMY] = $field;
return $form_fields;
}
开发者ID:kevinlangleyjr,项目名称:wp-media-categories,代码行数:25,代码来源:wp-media-categories.php
示例4: my_edit_user_profession_section
function my_edit_user_profession_section($user)
{
if (!current_user_can('manage_options')) {
return;
}
$privs = get_user_meta($user->ID, 'user_privelages', true);
$args = array('taxonomy' => 'pages', 'selected_cats' => $privs, 'checked_ontop' => false);
wp_terms_checklist($user->ID, $args);
}
开发者ID:CityOfPrescott,项目名称:tabula-rasa_city-of-prescott,代码行数:9,代码来源:functions-user.php
示例5: wp_category_checklist
/**
* Output an unordered list of checkbox <input> elements labelled
* with category names.
*
* @see wp_terms_checklist()
* @since 2.5.1
*
* @param int $post_id Mark categories associated with this post as checked. $selected_cats must not be an array.
* @param int $descendants_and_self ID of the category to output along with its descendents.
* @param bool|array $selected_cats List of categories to mark as checked.
* @param bool|array $popular_cats Override the list of categories that receive the "popular-category" class.
* @param object $walker Walker object to use to build the output.
* @param bool $checked_ontop Move checked items out of the hierarchy and to the top of the list.
*/
function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) {
wp_terms_checklist( $post_id, array(
'taxonomy' => 'category',
'descendants_and_self' => $descendants_and_self,
'selected_cats' => $selected_cats,
'popular_cats' => $popular_cats,
'walker' => $walker,
'checked_ontop' => $checked_ontop
) );
}
开发者ID:pauEscarcia,项目名称:AIMM,代码行数:24,代码来源:TEMPLATE.PHP
示例6: wpsc_add_variation_set
/**
* Add new variation set via AJAX.
*
* If the variation set name is the same as an existing variation set,
* the children variant terms will be added inside that existing set.
* @since 3.8.8
*/
function wpsc_add_variation_set()
{
$new_variation_set = $_POST['variation_set'];
$variants = preg_split('/\\s*,\\s*/', $_POST['variants']);
$parent_term_exists = term_exists($new_variation_set, 'wpsc-variation');
// only use an existing parent ID if the term is not a child term
if ($parent_term_exists) {
$parent_term = get_term($parent_term_exists['term_id'], 'wpsc-variation');
if ($parent_term->parent == '0') {
$variation_set_id = $parent_term_exists['term_id'];
}
}
if (empty($variation_set_id)) {
$results = wp_insert_term($new_variation_set, 'wpsc-variation');
if (is_wp_error($results)) {
die('-1');
}
$variation_set_id = $results['term_id'];
}
$inserted_variants = array();
if (!empty($variation_set_id)) {
foreach ($variants as $variant) {
$results = wp_insert_term($variant, 'wpsc-variation', array('parent' => $variation_set_id));
if (is_wp_error($results)) {
die('-1');
}
$inserted_variants[] = $results['term_id'];
}
require_once 'includes/walker-variation-checklist.php';
/* --- DIRTY HACK START --- */
/*
There's a bug with term cache in WordPress core. See http://core.trac.wordpress.org/ticket/14485.
The next 3 lines will delete children term cache for wpsc-variation.
Without this hack, the new child variations won't be displayed on "Variations" page and
also won't be displayed in wp_terms_checklist() call below.
*/
clean_term_cache($variation_set_id, 'wpsc-variation');
delete_option('wpsc-variation_children');
wp_cache_set('last_changed', 1, 'terms');
_get_term_hierarchy('wpsc-variation');
/* --- DIRTY HACK END --- */
wp_terms_checklist((int) $_POST['post_id'], array('taxonomy' => 'wpsc-variation', 'descendants_and_self' => $variation_set_id, 'walker' => new WPSC_Walker_Variation_Checklist($inserted_variants), 'checked_ontop' => false));
}
exit;
}
开发者ID:rmccue,项目名称:WP-e-Commerce,代码行数:52,代码来源:ajax-and-init.php
示例7: metabox
public static function metabox($post, $box)
{
if (!isset($box['args']) || !is_array($box['args'])) {
$args = [];
} else {
$args = $box['args'];
}
extract(wp_parse_args($args), EXTR_SKIP);
$tax_name = $taxonomy;
$taxonomy = get_taxonomy($taxonomy);
$disabled = !current_user_can($taxonomy->cap->assign_terms) ? 'disabled="disabled"' : '';
printf('<select name="tax_input[%s]" %s>', esc_attr($tax_name), $disabled);
if (!isset($taxonomy->required) || !$taxonomy->required) {
printf('<option value="">(%s)</option>', sprintf(__('no %s'), $taxonomy->labels->singular_name));
}
wp_terms_checklist($post->ID, ['taxonomy' => $taxonomy->name, 'walker' => new Walker_Taxonomy_Select()]);
echo '</select>';
}
开发者ID:functionlabs,项目名称:wp-single-value-taxonomy-ui,代码行数:18,代码来源:wp-single-value-taxonomy-ui.php
示例8: showcase_meta_box
/**
* Display portfolio showcase settings meta box
*
* @since 1.0.0
*
* @param object $post
*
* @return void
*/
public function showcase_meta_box($post)
{
$cats = get_post_meta($post->ID, '_portfolio_showcase_cat', true);
$limit = get_post_meta($post->ID, '_portfolio_showcase_limit', true);
$layout = get_post_meta($post->ID, '_portfolio_showcase_layout', true);
$gutter = get_post_meta($post->ID, '_portfolio_showcase_gutter', true);
$pagination = get_post_meta($post->ID, '_portfolio_showcase_pagination', true);
$filter = get_post_meta($post->ID, '_portfolio_showcase_filter', true);
$filter = $filter ? $filter : 'yes';
wp_nonce_field('ta_portfolio_showcase_' . $post->ID, '_tanonce');
?>
<table class="form-table">
<tr>
<th scope="row"><?php
_e('Category to display', 'ta-portfolio');
?>
</th>
<td>
<ul id="portfolio-category-checklist" class="categorychecklist">
<?php
wp_terms_checklist(0, array('selected_cats' => $cats, 'taxonomy' => 'portfolio_category', 'checked_ontop' => false));
?>
</ul>
</td>
</tr>
<tr>
<th scope="row"><label for="portfolio-limit"><?php
_e('Number of portfolio', 'ta-portfolio');
?>
</th>
<td>
<input type="number" name="_portfolio_showcase_limit" value="<?php
echo $limit ? $limit : 8;
?>
" id="portfolio-limit" size="3">
<p class="description">
<?php
_e('With Metro layout, the value for the best view is 5, 6, 8 or a multiple of 8, eg: 8, 16, 24...', 'ta-portfolio');
?>
</p>
</td>
</tr>
<tr>
<th scope="row"><label for="portfolio-layout"><?php
_e('Showcase Layout', 'ta-portfolio');
?>
</th>
<td>
<select name="_portfolio_showcase_layout" id="portfolio-layout">
<option value="fitRows" <?php
selected('fitRows', $layout);
?>
><?php
_e('Grid', 'ta-portfolio');
?>
</option>
<option value="masonry" <?php
selected('masonry', $layout);
?>
><?php
_e('Masonry', 'ta-portfolio');
?>
</option>
<option value="metro" <?php
selected('metro', $layout);
?>
><?php
_e('Metro', 'ta-portfolio');
?>
</option>
</select>
</td>
</tr>
<tr>
<th scope="row"><label for="portfolio-gutter"><?php
_e('Spacing', 'ta-portfolio');
?>
</th>
<td>
<input type="number" name="_portfolio_showcase_gutter" value="<?php
echo $gutter ? $gutter : 0;
?>
" id="portfolio-gutter" size="3"> px
<p class="description">
<?php
//.........这里部分代码省略.........
开发者ID:VeritasStrategies,项目名称:Poplin,代码行数:101,代码来源:class-showcase.php
示例9: wp_popular_terms_checklist
?>
</a></li>
</ul>
<div id="category-pop" class="tabs-panel" style="display: none;">
<ul id="categorychecklist-pop" class="categorychecklist form-no-clear" >
<?php
$popular_ids = wp_popular_terms_checklist('category');
?>
</ul>
</div>
<div id="category-all" class="tabs-panel">
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
<?php
wp_terms_checklist($post_ID, array('taxonomy' => 'category', 'popular_cats' => $popular_ids));
?>
</ul>
</div>
<?php
if (!current_user_can($tax->cap->assign_terms)) {
?>
<p><em><?php
_e('You cannot modify this Taxonomy.');
?>
</em></p>
<?php
}
?>
<?php
开发者ID:dcatontopcorp,项目名称:wordpress,代码行数:31,代码来源:press-this.php
示例10: inline_edit
//.........这里部分代码省略.........
</div></fieldset>
<?php
if (count($hierarchical_taxonomies) && !$bulk) {
?>
<fieldset class="inline-edit-col-center inline-edit-categories"><div class="inline-edit-col">
<?php
foreach ($hierarchical_taxonomies as $taxonomy) {
?>
<span class="title inline-edit-categories-label"><?php
echo esc_html($taxonomy->labels->name);
?>
<span class="catshow"><?php
_e('[more]');
?>
</span>
<span class="cathide" style="display:none;"><?php
_e('[less]');
?>
</span>
</span>
<input type="hidden" name="<?php
echo $taxonomy->name == 'category' ? 'post_category[]' : 'tax_input[' . esc_attr($taxonomy->name) . '][]';
?>
" value="0" />
<ul class="cat-checklist <?php
echo esc_attr($taxonomy->name);
?>
-checklist">
<?php
wp_terms_checklist(null, array('taxonomy' => $taxonomy->name));
?>
</ul>
<?php
}
//$hierarchical_taxonomies as $taxonomy
?>
</div></fieldset>
<?php
}
// count( $hierarchical_taxonomies ) && !$bulk
?>
<fieldset class="inline-edit-col-right"><div class="inline-edit-col">
<?php
if (post_type_supports($screen->post_type, 'author') && $bulk) {
echo $authors_dropdown;
}
if (post_type_supports($screen->post_type, 'page-attributes')) {
if ($post_type_object->hierarchical) {
?>
<label>
<span class="title"><?php
_e('Parent');
?>
</span>
<?php
$dropdown_args = array('post_type' => $post_type_object->name, 'selected' => $post->post_parent, 'name' => 'post_parent', 'show_option_none' => __('Main Page (no parent)'), 'option_none_value' => 0, 'sort_column' => 'menu_order, post_title');
if ($bulk) {
开发者ID:vivekkodira1,项目名称:wordpress,代码行数:67,代码来源:class-wp-posts-list-table.php
示例11: wpuf_category_checklist
/**
* Displays checklist of a taxonomy
*
* @since 0.8
* @param int $post_id
* @param array $selected_cats
*/
function wpuf_category_checklist($post_id = 0, $selected_cats = false, $tax = 'category')
{
require_once ABSPATH . '/wp-admin/includes/template.php';
$walker = new WPUF_Walker_Category_Checklist();
echo '<ul class="wpuf-category-checklist">';
wp_terms_checklist($post_id, array('taxonomy' => $tax, 'descendants_and_self' => 0, 'selected_cats' => $selected_cats, 'popular_cats' => false, 'walker' => $walker, 'checked_ontop' => false));
echo '</ul>';
}
开发者ID:dewavi,项目名称:occupysandy.net,代码行数:15,代码来源:wpuf-functions.php
示例12: post_categories_meta_box
/**
* Display post categories form fields.
*
* @since 2.6.0
*
* @todo Create taxonomy-agnostic wrapper for this.
*
* @param WP_Post $post Post object.
* @param array $box {
* Categories meta box arguments.
*
* @type string $id Meta box ID.
* @type string $title Meta box title.
* @type callable $callback Meta box display callback.
* @type array $args {
* Extra meta box arguments.
*
* @type string $taxonomy Taxonomy. Default 'category'.
* }
* }
*/
function post_categories_meta_box($post, $box)
{
$defaults = array('taxonomy' => 'category');
if (!isset($box['args']) || !is_array($box['args'])) {
$args = array();
} else {
$args = $box['args'];
}
$r = wp_parse_args($args, $defaults);
$tax_name = esc_attr($r['taxonomy']);
$taxonomy = get_taxonomy($r['taxonomy']);
?>
<div id="taxonomy-<?php
echo $tax_name;
?>
" class="categorydiv">
<ul id="<?php
echo $tax_name;
?>
-tabs" class="category-tabs">
<li class="tabs"><a href="#<?php
echo $tax_name;
?>
-all"><?php
echo $taxonomy->labels->all_items;
?>
</a></li>
<li class="hide-if-no-js"><a href="#<?php
echo $tax_name;
?>
-pop"><?php
_e('Most Used');
?>
</a></li>
</ul>
<div id="<?php
echo $tax_name;
?>
-pop" class="tabs-panel" style="display: none;">
<ul id="<?php
echo $tax_name;
?>
checklist-pop" class="categorychecklist form-no-clear" >
<?php
$popular_ids = wp_popular_terms_checklist($tax_name);
?>
</ul>
</div>
<div id="<?php
echo $tax_name;
?>
-all" class="tabs-panel">
<?php
$name = $tax_name == 'category' ? 'post_category' : 'tax_input[' . $tax_name . ']';
echo "<input type='hidden' name='{$name}[]' value='0' />";
// Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
?>
<ul id="<?php
echo $tax_name;
?>
checklist" data-wp-lists="list:<?php
echo $tax_name;
?>
" class="categorychecklist form-no-clear">
<?php
wp_terms_checklist($post->ID, array('taxonomy' => $tax_name, 'popular_cats' => $popular_ids));
?>
</ul>
</div>
<?php
if (current_user_can($taxonomy->cap->edit_terms)) {
?>
<div id="<?php
echo $tax_name;
?>
-adder" class="wp-hidden-children">
<a id="<?php
//.........这里部分代码省略.........
开发者ID:SayenkoDesign,项目名称:ividf,代码行数:101,代码来源:meta-boxes.php
示例13: post_categories_meta_box
/**
* Display post categories form fields.
*
* @since 2.6.0
*
* @param object $post
*/
function post_categories_meta_box($post, $box)
{
$defaults = array('taxonomy' => 'category');
if (!isset($box['args']) || !is_array($box['args'])) {
$args = array();
} else {
$args = $box['args'];
}
extract(wp_parse_args($args, $defaults), EXTR_SKIP);
$tax = get_taxonomy($taxonomy);
?>
<div id="taxonomy-<?php
echo $taxonomy;
?>
" class="categorydiv">
<ul id="<?php
echo $taxonomy;
?>
-tabs" class="category-tabs">
<li class="tabs"><a href="#<?php
echo $taxonomy;
?>
-all"><?php
echo $tax->labels->all_items;
?>
</a></li>
<li class="hide-if-no-js"><a href="#<?php
echo $taxonomy;
?>
-pop"><?php
_e('Most Used');
?>
</a></li>
</ul>
<div id="<?php
echo $taxonomy;
?>
-pop" class="tabs-panel" style="display: none;">
<ul id="<?php
echo $taxonomy;
?>
checklist-pop" class="categorychecklist form-no-clear" >
<?php
$popular_ids = wp_popular_terms_checklist($taxonomy);
?>
</ul>
</div>
<div id="<?php
echo $taxonomy;
?>
-all" class="tabs-panel">
<?php
$name = $taxonomy == 'category' ? 'post_category' : 'tax_input[' . $taxonomy . ']';
echo "<input type='hidden' name='{$name}[]' value='0' />";
// Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
?>
<ul id="<?php
echo $taxonomy;
?>
checklist" class="list:<?php
echo $taxonomy;
?>
categorychecklist form-no-clear">
<?php
wp_terms_checklist($post->ID, array('taxonomy' => $taxonomy, 'popular_cats' => $popular_ids));
?>
</ul>
</div>
<?php
if (current_user_can($tax->cap->edit_terms)) {
?>
<div id="<?php
echo $taxonomy;
?>
-adder" class="wp-hidden-children">
<h4>
<a id="<?php
echo $taxonomy;
?>
-add-toggle" href="#<?php
echo $taxonomy;
?>
-add" class="hide-if-no-js">
<?php
/* translators: %s: add new taxonomy label */
printf(__('+ %s'), $tax->labels->add_new_item);
?>
</a>
</h4>
<p id="<?php
echo $taxonomy;
//.........这里部分代码省略.........
开发者ID:ranjithinnergys,项目名称:WordPress,代码行数:101,代码来源:meta-boxes.php
示例14: do_meta_box
/**
* Display a meta box on the post editing screen.
*
* @param object $post The post object
* @param object $walker An optional term walker
* @param bool $show_none Whether to include a 'none' item in the term list
* @param string $type The taxonomy list type (checklist or dropdown)
* @return null
*/
function do_meta_box(WP_Post $post, Walker $walker = null, $show_none = false, $type = 'checklist')
{
$taxonomy = $this->taxo->taxonomy;
$tax = get_taxonomy($taxonomy);
$selected = wp_get_object_terms($post->ID, $taxonomy, array('fields' => 'ids'));
if ($show_none) {
if (isset($tax->labels->no_item)) {
$none = $tax->labels->no_item;
} else {
$none = __('Not Specified', 'ext_taxos');
}
} else {
$none = '';
}
?>
<div id="taxonomy-<?php
echo $taxonomy;
?>
" class="categorydiv">
<?php
switch ($type) {
case 'dropdown':
wp_dropdown_categories(array('show_option_none' => $none, 'hide_empty' => false, 'hierarchical' => true, 'show_count' => false, 'orderby' => 'name', 'selected' => $selected, 'id' => "{$taxonomy}dropdown", 'name' => "tax_input[{$taxonomy}]", 'taxonomy' => $taxonomy, 'walker' => $walker));
break;
case 'checklist':
default:
?>
<style type="text/css">
/* Style for the 'none' item: */
#<?php
echo $taxonomy;
?>
-0 {
color: #888;
border-top: 1px solid #eee;
margin-top: 5px;
}
</style>
<input type="hidden" name="tax_input[<?php
echo $taxonomy;
?>
][]" value="0" />
<ul id="<?php
echo $taxonomy;
?>
checklist" class="list:<?php
echo $taxonomy;
?>
categorychecklist form-no-clear">
<?php
# Standard WP Walker_Category_Checklist does not cut it
if (empty($walker) or !is_a($walker, 'Walker')) {
$walker = new Walker_ExtendedTaxonomyCheckboxes();
}
# Output the terms:
wp_terms_checklist($post->ID, array('taxonomy' => $taxonomy, 'walker' => $walker, 'selected_cats' => $selected, 'checked_ontop' => $this->args['checked_ontop']));
# Output the 'none' item:
if ($show_none) {
$output = '';
$o = (object) array('term_id' => 0, 'name' => $none, 'slug' => 'none');
if (empty($selected)) {
$_selected = array(0);
} else {
$_selected = $selected;
}
$args = array('taxonomy' => $taxonomy, 'selected_cats' => $_selected, 'disabled' => false);
$walker->start_el($output, $o, 1, $args);
$walker->end_el($output, $o, 1, $args);
echo $output;
}
?>
</ul>
<?php
break;
}
?>
</div>
<?php
}
开发者ID:m-e-h,项目名称:doc-directory,代码行数:94,代码来源:extended-taxos.php
示例15: mla_post_upload_ui
/**
* Echoes bulk edit area HTML to the Media/Add New screen
*
* Fires on the post upload UI screen; legacy (pre-3.5.0) upload interface.
* Anything echoed here goes below the "Maximum upload file size" message
* and above the id="media-items" div.
*
* @since 2.02
*
*/
public static function mla_post_upload_ui()
{
/*
* Only add our form to the Media/Add New screen. In particular,
* do NOT add it to the Media Manager Modal Window
*/
if (function_exists('get_current_screen')) {
$screen = get_current_screen();
} else {
$screen = NULL;
}
if (is_object($screen) && ('add' != $screen->action || 'media' != $screen->base)) {
return;
}
$taxonomies = get_object_taxonomies('attachment', 'objects');
$hierarchical_taxonomies = array();
$flat_taxonomies = array();
foreach ($taxonomies as $tax_name => $tax_object) {
if ($tax_object->hierarchical && $tax_object->show_ui && MLACore::mla_taxonomy_support($tax_name, 'quick-edit')) {
$hierarchical_taxonomies[$tax_name] = $tax_object;
} elseif ($tax_object->show_ui && MLACore::mla_taxonomy_support($tax_name, 'quick-edit')) {
$flat_taxonomies[$tax_name] = $tax_object;
}
}
$page_template_array = MLACore::mla_load_template('mla-add-new-bulk-edit.tpl');
if (!is_array($page_template_array)) {
/* translators: 1: ERROR tag 2: function name 3: non-array value */
error_log(sprintf(_x('%1$s: %2$s non-array "%3$s"', 'error_log', 'media-library-assistant'), __('ERROR', 'media-library-assistant'), 'MLAEdit::mla_post_upload_ui', var_export($page_template_array, true)), 0);
return;
}
/*
* The left-hand column contains the hierarchical taxonomies,
* e.g., Attachment Category
*/
$category_fieldset = '';
if (count($hierarchical_taxonomies)) {
$bulk_category_blocks = '';
foreach ($hierarchical_taxonomies as $tax_name => $tax_object) {
if (current_user_can($tax_object->cap->assign_terms)) {
ob_start();
wp_terms_checklist(NULL, array('taxonomy' => $tax_name));
$tax_checklist = ob_get_contents();
ob_end_clean();
$page_values = array('tax_html' => esc_html($tax_object->labels->name), 'more' => __('more', 'media-library-assistant'), 'less' => __('less', 'media-library-assistant'), 'tax_attr' => esc_attr($tax_name), 'tax_checklist' => $tax_checklist, 'Add' => __('Add', 'media-library-assistant'), 'Remove' => __('Remove', 'media-library-assistant'), 'Replace' => __('Replace', 'media-library-assistant'));
$category_block = MLAData::mla_parse_template($page_template_array['category_block'], $page_values);
$taxonomy_options = MLAData::mla_parse_template($page_template_array['taxonomy_options'], $page_values);
$bulk_category_blocks .= $category_block . $taxonomy_options;
}
// current_user_can
}
// foreach $hierarchical_taxonomies
$page_values = array('category_blocks' => $bulk_category_blocks);
$category_fieldset = MLAData::mla_parse_template($page_template_array['category_fieldset'], $page_values);
}
// count( $hierarchical_taxonomies )
/*
* The middle column contains the flat taxonomies,
* e.g., Attachment Tag
*/
$tag_fieldset = '';
if (count($flat_taxonomies)) {
$bulk_tag_blocks = '';
foreach ($flat_taxonomies as $tax_name => $tax_object) {
if (current_user_can($tax_object->cap->assign_terms)) {
$page_values = array('tax_html' => esc_html($tax_object->labels->name), 'tax_attr' => esc_attr($tax_name), 'Add' => __('Add', 'media-library-assistant'), 'Remove' => __('Remove', 'media-library-assistant'), 'Replace' => __('Replace', 'media-library-assistant'));
$tag_block = MLAData::mla_parse_template($page_template_array['tag_block'], $page_values);
$taxonomy_options = MLAData::mla_parse_template($page_template_array['taxonomy_options'], $page_values);
$bulk_tag_blocks .= $tag_block . $taxonomy_options;
}
// current_user_can
}
// foreach $flat_taxonomies
$page_values = array('tag_blocks' => $bulk_tag_blocks);
$tag_fieldset = MLAData::mla_parse_template($page_template_array['tag_fieldset'], $page_values);
}
// count( $flat_taxonomies )
/*
* The right-hand column contains the standard and custom fields
*/
if ($authors = MLA::mla_authors_dropdown(-1)) {
$authors_dropdown = ' <label class="inline-edit-author alignright">' . "\n";
$authors_dropdown .= ' <span class="title">' . __('Author', 'media-library-assistant') . '</span>' . "\n";
$authors_dropdown .= $authors . "\n";
$authors_dropdown .= ' </label>' . "\n";
} else {
$authors_dropdown = '';
}
$custom_fields = '';
foreach (MLACore::mla_custom_field_support('bulk_edit') as $slug => $details) {
$page_values = array('slug' => $slug, 'label' => esc_attr($details['name']));
//.........这里部分代码省略.........
开发者ID:axeljohansson1988,项目名称:oddcv,代码行数:101,代码来源:class-mla-edit-media.php
示例16: quick_edit_custom_box
/**
* Quick edit form
*
* @since 1.1
*/
function quick_edit_custom_box($column_name, $screen)
{
if (!is_array($this->tax_obj->object_type) || !in_array($screen, $this->tax_obj->object_type) || $column_name != 'radio-' . $this->taxonomy) {
return false;
}
//needs the same name as metabox nonce
wp_nonce_field("add-{$this->taxonomy}", "_ajax_nonce-add-{$this->taxonomy}", false);
?>
<fieldset class="inline-edit-col-left inline-edit-categories">
<div class="inline-edit-col">
<span class="title inline-edit-categories-label"><?php
echo esc_html($this->tax_obj->labels->name);
?>
<span class="catshow"><?php
_e('[more]');
?>
</span>
<span class="cathide" style="display:none;"><?php
_e('[less]');
?>
</span>
</span>
<input type="hidden" name="<?php
echo 'radio_tax_input[' . esc_attr($this->taxonomy) . '][]';
?>
" value="0" />
<ul id="<?php
echo $this->taxonomy;
?>
" class="radio-checklist cat-checklist <?php
echo esc_attr($this->tax_obj->labels->name);
?>
-checklist">
<?php
wp_terms_checklist(null, array('taxonomy' => $this->taxonomy));
?>
</ul>
</div>
</fieldset>
<?php
}
开发者ID:jimlongo56,项目名称:bhouse,代码行数:47,代码来源:class.WordPress_Radio_Taxonomy.php
示例17: woo_tumblog_dashboard_widget_output
//.........这里部分代码省略.........
?>
47%;float:left;<?php
} else {
?>
94%;<?php
}
?>
">
<strong><label for="post_category[]">Additional Categories : </label></strong>
<?php
// START - MULTI CATEGORY DROP DOWN
?>
<?php
$taxonomy = 'category';
?>
<div id="<?php
echo $taxonomy;
?>
-all" class="tabs-panel" style="height:100px;overflow:auto;border: 1px solid #CCCCCC;margin-top:6px;margin-bottom:6px;">
<?php
$name = $taxonomy == 'category' ? 'post_category' : 'tax_input[' . $taxonomy . ']';
?>
<ul id="<?php
echo $taxonomy;
?>
checklist" class="list:<?php
echo $taxonomy;
?>
categorychecklist form-no-clear">
<?php
if (function_exists('wp_terms_checklist')) {
wp_terms_checklist($post_id, array('taxonomy' => $taxonomy));
?>
<?php
} else {
wp_category_checklist();
}
?>
</ul>
<?php
// END - MULTI CATEGORY DROP DOWN
?>
</div>
</div>
<?php
if (get_option('woo_tumblog_content_method') != 'post_format') {
?>
<div id="additional-tumblogs" style="width:47%;float:right;">
<strong><label for="post_tumblog[]">Additional Tumblogs : </label></strong>
<?php
// START - MULTI TUMBLOG DROP DOWN
?>
<?php
$taxonomy = 'tumblog';
?>
<div id="<?php
echo $taxonomy;
开发者ID:rongandat,项目名称:sallumeh,代码行数:67,代码来源:admin-tumblog-quickpress.php
示例18: newrs_post_categories_meta_box
/**
* Display post categories form fields. Based on default WP method.
*
* @param object $post
*/
private static function newrs_post_categories_meta_box($post, $box)
{
$defaults = array('taxonomy' => 'category');
if (!isset($box['args']) || !is_array($box['args'])) {
$args = array();
} else {
$args = $box['args'];
}
extract(wp_parse_args($args, $defaults), EXTR_SKIP);
$tax = get_taxonomy($taxonomy);
//$checked_texonomies = isset($args['selected_cats']) ? $args['selected_cats'] : '';
echo '<h4>' . $args['label'] . __(' to include:', 'new_royalslider') . '</h4>';
$terms_list = (array) get_terms($taxonomy, array('child_of' => 0, 'hierarchical' => 0, 'hide_empty' => 0));
if (count($terms_list) > 2000) {
echo '<p><em>' . __('This taxonomy has too large number of items to display in admin (>2000). If you wish to add it <a target="_blank" href="http://help.dimsemenov.com/kb/wordpress-royalslider-advanced/wp-modifying-order-of-posts-in-slider">do this programatically</a>.', 'new_royalslider') . '</em></p>';
return;
}
ob_start();
$popular_ids = wp_popular_terms_checklist($taxonomy);
$popular_terms = ob_get_contents();
ob_end_clean();
?>
<div id="taxonomy-<?php
echo $taxonomy;
?>
" class="categorydiv">
<ul id="<?php
echo $taxonomy;
?>
-tabs" class="category-tabs">
<li class="tabs"><a href="#<?php
echo $taxonomy;
?>
-all"><?php
echo $tax->labels->all_items;
?>
</a></li>
<li class="hide-if-no-js"><a href="#<?php
echo $taxonomy;
?>
-pop"><?php
_e('Most Used', 'new_royalslider');
?>
</a></li>
</ul>
<div id="<?php
echo $taxonomy;
?>
-pop" class="tabs-panel" style="display: none;">
<ul id="<?php
echo $taxonomy;
?>
checklist-pop" class="categorychecklist form-no-clear" >
<?php
echo $popular_terms;
?>
</ul>
</div>
<div id="<?php
echo $taxonomy;
?>
-all" class="tabs-panel">
<ul id="<?php
echo $taxonomy;
?>
checklist" data-wp-lists="list:<?php
echo $taxonomy;
?>
" class="categorychecklist form-no-clear main-opts">
<?php
wp_terms_checklist(0, array('taxonomy' => $taxonomy, 'selected_cats' => $checked_texonomies, 'popular_cats' => $popular_ids));
?>
</ul>
</div>
</div>
<?php
}
开发者ID:Telemedellin,项目名称:feriadelasfloresmedellin,代码行数:84,代码来源:Posts.php
示例19: mass_photo_posting
//.........这里部分代码省略.........
<span class="title"><?php
_e('Title', MAX_SHORTNAME);
?>
</span>
<span class="input-text-wrap">
<input type="text" id="post_name" class="post_name">
</span>
</label>
<label>
<span class="title"><?php
_e('Tags', MAX_SHORTNAME);
?>
</span>
<span class="input-text-wrap">
<textarea id="post_tags" class="post_tags tax_input_post_tag"></textarea>
</span>
</label>
<label>
<span class="input-text-wrap"><span class="text-description"><?php
_e('Changes made in this line will be incorporated into other lines.', MAX_SHORTNAME);
?>
</span></span>
</label>
</fieldset>
</td>
&l
|
请发表评论