本文整理汇总了PHP中get_terms_to_edit函数的典型用法代码示例。如果您正苦于以下问题:PHP get_terms_to_edit函数的具体用法?PHP get_terms_to_edit怎么用?PHP get_terms_to_edit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_terms_to_edit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cwp_taxonomy_meta_box
/**
* Display post tags form fields.
*
* @since 2.6.0
*
* @param object $post
*/
function cwp_taxonomy_meta_box($post, $box)
{
$tax_name = esc_attr(substr($box['id'], 25));
$taxonomy = get_taxonomy($tax_name);
$helps = isset($taxonomy->helps) ? esc_attr($taxonomy->helps) : __('Separate ' . $tax_name . 's with commas.');
?>
<div class="tagsdiv" id="<?php
echo $tax_name;
?>
">
<div class="jaxtag">
<div class="nojs-tags hide-if-js">
<p><?php
_e('Add or remove tags');
?>
</p>
<textarea name="<?php
echo "tax_input[{$tax_name}]";
?>
" class="the-tags" id="tax-input[<?php
echo $tax_name;
?>
]"><?php
echo esc_attr(get_terms_to_edit($post->ID, $tax_name));
?>
</textarea></div>
<span class="ajaxtag hide-if-no-js">
<label class="screen-reader-text" for="new-tag-<?php
echo $tax_name;
?>
"><?php
echo $box['title'];
?>
</label>
<input type="text" id="new-tag-<?php
echo $tax_name;
?>
" name="newtag[<?php
echo $tax_name;
?>
]" class="newtag form-input-tip" size="16" autocomplete="off" value="<?php
esc_attr_e('Add new ' . $tax_name);
?>
示例2: get
function get($data)
{
extract($data);
if ('terminput' == $type) {
$tags = get_terms_to_edit($post_id, $taxonomy);
$tags = str_replace(',', ', ', $tags);
return $tags;
} else {
$terms = get_the_terms($post_id, $taxonomy);
if (empty($terms)) {
$selected = 0;
} else {
$selected = reset($terms)->term_id;
}
return wp_dropdown_categories(array('taxonomy' => $taxonomy, 'selected' => $selected, 'hide_empty' => false, 'hierarchical' => true, 'show_option_none' => __('— None —', 'front-end-editor'), 'echo' => false));
}
}
示例3: post_tags_meta_box
/**
* Display post tags form fields.
*
* @since 2.6.0
*
* @param object $post
*/
function post_tags_meta_box($post, $box)
{
$defaults = array('taxonomy' => 'post_tag');
if (!isset($box['args']) || !is_array($box['args'])) {
$args = array();
} else {
$args = $box['args'];
}
extract(wp_parse_args($args, $defaults), EXTR_SKIP);
$tax_name = esc_attr($taxonomy);
$taxonomy = get_taxonomy($taxonomy);
$disabled = !current_user_can($taxonomy->cap->assign_terms) ? 'disabled="disabled"' : '';
?>
<div class="tagsdiv" id="<?php
echo $tax_name;
?>
">
<div class="jaxtag">
<div class="nojs-tags hide-if-js">
<p><?php
echo $taxonomy->labels->add_or_remove_items;
?>
</p>
<textarea name="<?php
echo "tax_input[{$tax_name}]";
?>
" rows="3" cols="20" class="the-tags" id="tax-input-<?php
echo $tax_name;
?>
" <?php
echo $disabled;
?>
><?php
echo esc_attr(get_terms_to_edit($post->ID, $tax_name));
?>
</textarea></div>
<?php
if (current_user_can($taxonomy->cap->assign_terms)) {
?>
<div class="ajaxtag hide-if-no-js">
<label class="screen-reader-text" for="new-tag-<?php
echo $tax_name;
?>
"><?php
echo $box['title'];
?>
</label>
<div class="taghint"><?php
echo $taxonomy->labels->add_new_item;
?>
</div>
<p><input type="text" id="new-tag-<?php
echo $tax_name;
?>
" name="newtag[<?php
echo $tax_name;
?>
]" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
<input type="button" class="button tagadd" value="<?php
esc_attr_e('Add');
?>
" tabindex="3" /></p>
</div>
<p class="howto"><?php
echo esc_attr($taxonomy->labels->separate_items_with_commas);
?>
</p>
<?php
}
?>
</div>
<div class="tagchecklist"></div>
</div>
<?php
if (current_user_can($taxonomy->cap->assign_terms)) {
?>
<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php
echo $tax_name;
?>
"><?php
echo $taxonomy->labels->choose_from_most_used;
?>
</a></p>
<?php
} else {
?>
<p><em><?php
_e('You cannot modify this taxonomy.');
?>
</em></p>
<?php
}
}
示例4: get_inline_data
/**
* {@internal Missing Short Description}}
*
* @since 2.7.0
*
* @param unknown_type $post
*/
function get_inline_data($post)
{
$post_type_object = get_post_type_object($post->post_type);
if (!current_user_can($post_type_object->cap->edit_post, $post->ID)) {
return;
}
$title = esc_textarea(trim($post->post_title));
echo '
<div class="hidden" id="inline_' . $post->ID . '">
<div class="post_title">' . $title . '</div>
<div class="post_name">' . apply_filters('editable_slug', $post->post_name) . '</div>
<div class="post_author">' . $post->post_author . '</div>
<div class="comment_status">' . esc_html($post->comment_status) . '</div>
<div class="ping_status">' . esc_html($post->ping_status) . '</div>
<div class="_status">' . esc_html($post->post_status) . '</div>
<div class="jj">' . mysql2date('d', $post->post_date, false) . '</div>
<div class="mm">' . mysql2date('m', $post->post_date, false) . '</div>
<div class="aa">' . mysql2date('Y', $post->post_date, false) . '</div>
<div class="hh">' . mysql2date('H', $post->post_date, false) . '</div>
<div class="mn">' . mysql2date('i', $post->post_date, false) . '</div>
<div class="ss">' . mysql2date('s', $post->post_date, false) . '</div>
<div class="post_password">' . esc_html($post->post_password) . '</div>';
if ($post_type_object->hierarchical) {
echo '<div class="post_parent">' . $post->post_parent . '</div>';
}
if ($post->post_type == 'page') {
echo '<div class="page_template">' . esc_html(get_post_meta($post->ID, '_wp_page_template', true)) . '</div>';
}
if ($post_type_object->hierarchical) {
echo '<div class="menu_order">' . $post->menu_order . '</div>';
}
$taxonomy_names = get_object_taxonomies($post->post_type);
foreach ($taxonomy_names as $taxonomy_name) {
$taxonomy = get_taxonomy($taxonomy_name);
if ($taxonomy->hierarchical && $taxonomy->show_ui) {
echo '<div class="post_category" id="' . $taxonomy_name . '_' . $post->ID . '">' . implode(',', wp_get_object_terms($post->ID, $taxonomy_name, array('fields' => 'ids'))) . '</div>';
} elseif ($taxonomy->show_ui) {
echo '<div class="tags_input" id="' . $taxonomy_name . '_' . $post->ID . '">' . esc_html(str_replace(',', ', ', get_terms_to_edit($post->ID, $taxonomy_name))) . '</div>';
}
}
if (!$post_type_object->hierarchical) {
echo '<div class="sticky">' . (is_sticky($post->ID) ? 'sticky' : '') . '</div>';
}
if (post_type_supports($post->post_type, 'post-formats')) {
echo '<div class="post_format">' . esc_html(get_post_format($post->ID)) . '</div>';
}
echo '</div>';
}
示例5: _build_inline_data
/**
* Add hidden fields with the data for use in the inline editor
*
* @since 0.20
*
* @param object A singular attachment (post) object
*
* @return string HTML <div> with row data
*/
private function _build_inline_data($item)
{
$inline_data = "\r\n" . '<div class="hidden" id="inline_' . $item->ID . "\">\r\n";
$inline_data .= ' <div class="post_title">' . esc_attr($item->post_title) . "</div>\r\n";
$inline_data .= ' <div class="post_name">' . esc_attr($item->post_name) . "</div>\r\n";
$inline_data .= ' <div class="post_excerpt">' . esc_attr($item->post_excerpt) . "</div>\r\n";
$inline_data .= ' <div class="post_content">' . esc_attr($item->post_content) . "</div>\r\n";
if (!empty($item->mla_wp_attachment_metadata)) {
if (isset($item->mla_wp_attachment_image_alt)) {
$inline_data .= ' <div class="image_alt">' . esc_attr($item->mla_wp_attachment_image_alt) . "</div>\r\n";
} else {
$inline_data .= ' <div class="image_alt">' . "</div>\r\n";
}
}
$inline_data .= ' <div class="post_parent">' . $item->post_parent . "</div>\r\n";
$inline_data .= ' <div class="menu_order">' . $item->menu_order . "</div>\r\n";
$inline_data .= ' <div class="post_author">' . $item->post_author . "</div>\r\n";
$custom_fields = MLAOptions::mla_custom_field_support('quick_edit');
$custom_fields = array_merge($custom_fields, MLAOptions::mla_custom_field_support('bulk_edit'));
foreach ($custom_fields as $slug => $label) {
$value = get_metadata('post', $item->ID, $label, true);
$inline_data .= ' <div class="' . $slug . '">' . esc_html($value) . "</div>\r\n";
}
$taxonomies = get_object_taxonomies('attachment', 'objects');
foreach ($taxonomies as $tax_name => $tax_object) {
if ($tax_object->hierarchical && $tax_object->show_ui && MLAOptions::mla_taxonomy_support($tax_name, 'quick-edit')) {
$inline_data .= ' <div class="mla_category" id="' . $tax_name . '_' . $item->ID . '">' . implode(',', wp_get_object_terms($item->ID, $tax_name, array('fields' => 'ids'))) . "</div>\r\n";
} elseif ($tax_object->show_ui && MLAOptions::mla_taxonomy_support($tax_name, 'quick-edit')) {
$inline_data .= ' <div class="mla_tags" id="' . $tax_name . '_' . $item->ID . '">' . esc_html(str_replace(',', ', ', get_terms_to_edit($item->ID, $tax_name))) . "</div>\r\n";
}
}
$inline_data .= "</div>\r\n";
return $inline_data;
}
示例6: print_cpt_onomy_meta_box
/**
* This function is invoked when a CPT-onomy meta box is attached to a post type's edit post screen.
* This 'callback' function prints the html for the meta box.
*
* The meta box consists of a checklist that allows the user to assign/manage the taxonomy's terms.
* This function mimics a meta box for an ordinary custom taxonomy.
*
* Version 1.1 brought support for 'autocomplete' and 'dropdown' selection format,
* on top of the already existent 'checklist'.
*
* CPT-onomies follows default WordPress behavior, providing a checklist for hierarchical
* CPT-onomies and the autocomplete box for non-hierarchical CPT-onomies. You can change the
* format by hooking into the 'custom_post_type_onomies_meta_box_format' filter, which passes
* two parameters: the $taxonomy and the $post_type.
*
* You can designate that you only want specific terms listed in the results by returning their
* term IDs using the 'custom_post_type_onomies_assigning_cpt_onomy_terms_include_term_ids'
* filter which passes three parameters: the $taxonomy, the $post_type and the $post_id.
*
* You can disable specific terms from being listed in the results by returning their
* term IDs using the 'custom_post_type_onomies_assigning_cpt_onomy_terms_exclude_term_ids'
* filter which passes three parameters: the $taxonomy, the $post_type and the $post_id.
*
* This code mimics the WordPress function post_categories_meta_box().
*
* This function is invoked by the action 'add_meta_boxes'.
*
* @since 1.0
* @param object $post - the current post's information
* @param array $box - information about the metabox
* @filters 'custom_post_type_onomies_meta_box_format' - $taxonomy, $post_type
*/
public function print_cpt_onomy_meta_box($post, $metabox)
{
// add nonce
wp_nonce_field('assigning_' . CPT_ONOMIES_UNDERSCORE . '_taxonomy_relationships', CPT_ONOMIES_UNDERSCORE . '_nonce');
// define variables
$post_type = isset($post->post_type) && !empty($post->post_type) && post_type_exists($post->post_type) ? $post->post_type : NULL;
$taxonomy = isset($metabox['args']['taxonomy']) && !empty($metabox['args']['taxonomy']) && taxonomy_exists($metabox['args']['taxonomy']) ? $metabox['args']['taxonomy'] : NULL;
if ($post_type && $taxonomy) {
// get taxonomy info
$tax = get_taxonomy($taxonomy);
// if 'meta_box_format' is not defined, use default WordPress setting
if (!($format = isset($tax->meta_box_format) && !empty($tax->meta_box_format) ? $tax->meta_box_format : NULL)) {
$format = is_post_type_hierarchical($taxonomy) ? 'checklist' : 'autocomplete';
}
// allow the user to change the format - 'autocomplete', 'dropdown', 'checklist' - default
$format = apply_filters('custom_post_type_onomies_meta_box_format', $format, $taxonomy, $post_type);
// does the user have permission to assign terms?
$disabled = !current_user_can($tax->cap->assign_terms) ? ' disabled="disabled"' : '';
// allows you to use the 'custom_post_type_onomies_assigning_cpt_onomy_terms_include_term_ids' filter
// to designate that you only want specific terms to be printed and therefore assigned. The term ids
// are stored in an array that is used to customize each printed format. 'Include' overwrites 'exclude'.
$include_term_ids = $this->get_cpt_onomy_terms_include_term_ids($taxonomy, $post_type, $post->ID);
// allows you to use the 'custom_post_type_onomies_assigning_cpt_onomy_terms_exclude_term_ids' filter
// to exclude specific terms from being printed and therefore assigned. The term ids are stored in
// an array that is used to customize each printed format. While 'include' overwrites 'exclude', if
// exclude terms are in the include array, they will be removed.
$exclude_term_ids = $this->get_cpt_onomy_terms_exclude_term_ids($taxonomy, $post_type, $post->ID);
// add field for testing "editability" when we save the information
?>
<input type="hidden" name="assign_cpt_onomies_<?php
echo $taxonomy;
?>
_rel" value="1" /><?php
switch ($format) {
case 'autocomplete':
?>
<div id="taxonomy-<?php
echo $taxonomy;
?>
" class="cpt_onomies_tags_div">
<div class="jaxtag">
<div class="nojs-tags hide-if-js">
<p><?php
_e($tax->labels->add_or_remove_items, CPT_ONOMIES_TEXTDOMAIN);
?>
</p>
<textarea name="<?php
echo CPT_ONOMIES_POSTMETA_KEY;
?>
[<?php
echo $taxonomy;
?>
]" rows="3" cols="20" class="the-tags" id="tax-input-<?php
echo $taxonomy;
?>
"<?php
echo $disabled;
?>
><?php
echo get_terms_to_edit($post->ID, $taxonomy);
// textarea_escaped by esc_attr()
?>
</textarea>
</div>
<?php
if (current_user_can($tax->cap->assign_terms)) {
?>
<div class="ajaxtag hide-if-no-js">
//.........这里部分代码省略.........
示例7: post_tags_meta_box
/**
* Display post tags form fields.
*
* @since 2.6.0
*
* @param object $post
*/
function post_tags_meta_box($post, $box)
{
$tax_name = substr($box['id'], 8);
$taxonomy = get_taxonomy($tax_name);
$helps = isset($taxonomy->helps) ? attribute_escape($taxonomy->helps) : __('Separate tags with commas.');
?>
<div class="tagsdiv" id="<?php
echo $tax_name;
?>
">
<p class="jaxtag">
<label class="hidden" for="newtag"><?php
_e($box['title']);
?>
</label>
<input type="hidden" name="<?php
echo "tax_input[{$tax_name}]";
?>
" class="the-tags" id="tax-input[<?php
echo $tax_name;
?>
]" value="<?php
echo get_terms_to_edit($post->ID, $tax_name);
?>
" />
<span class="ajaxtag">
<input type="text" name="newtag[<?php
echo $tax_name;
?>
]" class="newtag form-input-tip" size="16" autocomplete="off" value="<?php
_e('Add new tag');
?>
" />
<input type="button" class="button tagadd" value="<?php
_e('Add');
?>
" tabindex="3" />
</span></p>
<p class="howto"><?php
echo $helps;
?>
</p>
<div class="tagchecklist"></div>
</div>
<p class="tagcloud-link hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php
echo $tax_name;
?>
"><?php
printf(__('Choose from the most used tags in %s'), $box['title']);
?>
</a></p>
<?php
}
示例8: bp_docs_post_tags_meta_box
/**
* Display post tags form fields. Based on WP core's post_tags_meta_box()
*
* @since 1.0-beta
*
* @param object $post
*/
function bp_docs_post_tags_meta_box()
{
global $bp;
require_once ABSPATH . '/wp-admin/includes/taxonomy.php';
$defaults = array('taxonomy' => $bp->bp_docs->docs_tag_tax_name);
if (!isset($box['args']) || !is_array($box['args'])) {
$args = array();
} else {
$args = $box['args'];
}
extract(wp_parse_args($args, $defaults), EXTR_SKIP);
$tax_name = esc_attr($taxonomy);
$taxonomy = get_taxonomy($taxonomy);
// If this is a failed submission, use the value from the POST cookie
if (!empty(buddypress()->bp_docs->submitted_data->{$tax_name})) {
$terms = buddypress()->bp_docs->submitted_data->{$tax_name};
// If it's an existing Doc, look up the terms
} else {
if (bp_docs_is_existing_doc()) {
$terms = get_terms_to_edit(get_the_ID(), $bp->bp_docs->docs_tag_tax_name);
// Otherwise nothing to show
} else {
$terms = '';
}
}
?>
<textarea name="<?php
echo "{$tax_name}";
?>
" class="the-tags" id="tax-input-<?php
echo $tax_name;
?>
"><?php
echo esc_textarea($terms);
?>
</textarea>
<?php
}
示例9: tags_html
/**
* Outputs the tags HTML.
*
* @since 4.2.0
* @access public
*
* @param WP_Post $post Post object.
*/
public function tags_html($post)
{
$taxonomy = get_taxonomy('post_tag');
$user_can_assign_terms = current_user_can($taxonomy->cap->assign_terms);
$esc_tags = get_terms_to_edit($post->ID, 'post_tag');
if (!$esc_tags || is_wp_error($esc_tags)) {
$esc_tags = '';
}
?>
<div class="tagsdiv" id="post_tag">
<div class="jaxtag">
<input type="hidden" name="tax_input[post_tag]" class="the-tags" value="<?php
echo $esc_tags;
// escaped in get_terms_to_edit()
?>
">
<?php
if ($user_can_assign_terms) {
?>
<div class="ajaxtag hide-if-no-js">
<label class="screen-reader-text" for="new-tag-post_tag"><?php
_e('Tags');
?>
</label>
<p>
<input type="text" id="new-tag-post_tag" name="newtag[post_tag]" class="newtag form-input-tip" size="16" autocomplete="off" value="" aria-describedby="new-tag-desc" />
<button type="button" class="tagadd"><?php
_e('Add');
?>
</button>
</p>
</div>
<p class="howto" id="new-tag-desc">
<?php
echo $taxonomy->labels->separate_items_with_commas;
?>
</p>
<?php
}
?>
</div>
<div class="tagchecklist"></div>
</div>
<?php
if ($user_can_assign_terms) {
?>
<button type="button" class="button-reset button-link tagcloud-link" id="link-post_tag"><?php
echo $taxonomy->labels->choose_from_most_used;
?>
</button>
<?php
}
}
示例10: show_property_tags_rightpanel
function show_property_tags_rightpanel($property)
{
$taxes = get_object_taxonomies(STAYPRESS_PROPERTY_POST_TYPE);
if ($taxes) {
foreach ($taxes as $key => $value) {
if (is_taxonomy_hierarchical($value)) {
//$mtax = get_taxonomy($value);
// Test with standard box
$this->show_hierachical_metabox($property, array('args' => array('taxonomy' => $value)));
} else {
$mtax = get_taxonomy($value);
echo "<div class='sidebarbox'>";
echo '<div title="Click to toggle" class="handlediv" ><br></div>';
echo "<h2 class='rightbarheading'>" . esc_html($mtax->label) . "</h2>";
echo "<div class='innersidebarbox'>";
$tax_name = $value;
?>
<div class="tagsdiv" id="<?php
echo $tax_name;
?>
">
<div class="jaxtag">
<div class="nojs-tags hide-if-js">
<p><?php
_e('Add or remove tags');
?>
</p>
<textarea name="<?php
echo "tax_input[{$tax_name}]";
?>
" class="the-tags" id="tax-input[<?php
echo $tax_name;
?>
]"><?php
echo esc_attr(get_terms_to_edit($property->ID, $tax_name));
?>
</textarea>
</div>
<div class="ajaxtag hide-if-no-js">
<label class="screen-reader-text" for="new-tag-<?php
echo $tax_name;
?>
"><?php
echo $mtax->label;
?>
</label>
<div class="taghint"><?php
_e('Add new tag');
?>
</div>
<input type="text" id="new-tag-<?php
echo $tax_name;
?>
" name="newtag[<?php
echo $tax_name;
?>
]" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
<input type="button" class="button tagadd" value="<?php
esc_attr_e('Add');
?>
" tabindex="3" />
</div>
</div>
<p class="howto"><?php
echo _('Separate tags with commas.');
?>
</p>
<div class="tagchecklist"></div>
</div>
<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php
echo $tax_name;
?>
"><?php
printf(__('Choose from the most used tags in %s'), $mtax->label);
?>
</a></p>
<?php
echo "</div> <!-- innersidebarbox -->";
echo "</div> <!-- sidebarbox -->";
}
}
}
}
示例11: attachment_fields_to_edit
/**
* Edit Image Form
*
* @param array $form_fields Form fields array.
* @param object $post Post.
* @return array Form fields.
*/
function attachment_fields_to_edit($form_fields, $post)
{
global $AttachmentTaxSupp, $current_screen;
foreach ($form_fields as $key => $val) {
if (isset($val['hierarchical']) && taxonomy_exists($val['name'])) {
$tax_name = esc_attr($val['name']);
$taxonomy = get_taxonomy($val['name']);
if ($val['hierarchical'] == true) {
//$popular_ids = wp_popular_terms_checklist( $tax_name );
ob_start();
//wp_terms_checklist( $post->ID, array( 'taxonomy' => $tax_name, 'popular_cats' => $popular_ids, 'walker' => new AttachmentTaxSupp_Walker_Category_Checklist ) );
$wp_terms_checklist_walker = new AttachmentTaxSupp_Walker_Category_Checklist();
$wp_terms_checklist_walker->attachment_id = $post->ID;
wp_terms_checklist($post->ID, array('taxonomy' => $tax_name, 'walker' => $wp_terms_checklist_walker));
$checklist = ob_get_contents();
ob_end_clean();
$html = '<div class="inside">
<div id="taxonomy-' . $tax_name . '" class="categorydiv">
<ul id="' . $tax_name . '-tabs" class="category-tabs">
<li class="tabs" style="display: inline;"><a href="#' . $tax_name . '-all" tabindex="3" style="text-decoration:none;">' . $taxonomy->labels->all_items . '</a></li>
<!--<li class="hide-if-no-js" style="display: inline;"><a href="#' . $tax_name . '-pop" tabindex="3" style="text-decoration:none;">' . __('Most Used') . '</a></li>-->
</ul>
<div id="' . $tax_name . '-pop" class="tabs-panel" style="display: none;">
<ul id="' . $tax_name . 'checklist-pop" class="categorychecklist form-no-clear" >
</ul>
</div>
<div id="' . $tax_name . '-all" class="tabs-panel">
<input type="hidden" name="' . $tax_name . '[]" value="0" />
<ul id="' . $tax_name . 'checklist" class="list:' . $tax_name . ' categorychecklist form-no-clear">
' . $checklist . '
</ul>
</div>';
/*
if ( current_user_can( $taxonomy->cap->edit_terms ) ) :
$html .= '
<div id="category-adder" class="wp-hidden-children">
<h4>
<a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3">+ Add New Category</a>
</h4>
<p id="category-add" class="category-add wp-hidden-child">
<label class="screen-reader-text" for="newcategory">Add New Category</label>
<input type="text" name="newcategory" id="newcategory" class="form-required form-input-tip" value="New Category Name" tabindex="3" aria-required="true">
<label class="screen-reader-text" for="newcategory_parent">
Parent Category:</label>
<select name="newcategory_parent" id="newcategory_parent" class="postform" tabindex="3">
<option value="-1">— Parent Category —</option>
<option class="level-0" value="33">Temp</option>
<option class="level-0" value="34">Temp 2</option>
<option class="level-1" value="36"> Temp 5</option>
<option class="level-0" value="35">Temp 3</option>
<option class="level-0" value="1">Uncategorized</option>
</select>
<input type="button" id="category-add-submit" class="add:categorychecklist:category-add button category-add-sumbit" value="Add New Category" tabindex="3">
<input type="hidden" id="_ajax_nonce-add-category" name="_ajax_nonce-add-category" value="092592c9e4">
<span id="category-ajax-response"></span>
</p>
</div>';
endif;
*/
$html .= '
</div>
<p><a href="' . admin_url('/edit-tags.php?taxonomy=' . $tax_name . '&post_type=attachment') . '">' . __('Manage', 'attachmenttaxsupp') . ' ' . $taxonomy->labels->name . '</a></p>
</div>';
$html .= wp_nonce_field('update_attachment', '_wpnonce_attachmenttaxsupp', true, false);
$form_fields[$key]['input'] = 'html';
$form_fields[$key]['html'] = $html;
} else {
$disabled = !current_user_can($taxonomy->cap->assign_terms) ? ' disabled="disabled"' : '';
$html = '<div class="inside">
<div class="tagsdiv" id="' . $tax_name . '">
<div class="jaxtag">
<div class="nojs-tags hide-if-js">
<p>' . $taxonomy->labels->add_or_remove_items . '</p>
<textarea name="attachments[' . $post->ID . '][' . $tax_name . ']" rows="3" cols="20" class="the-tags" id="attachments[' . $post->ID . '][' . $tax_name . ']"' . $disabled . ' style="margin:0px;">' . get_terms_to_edit($post->ID, $tax_name) . '</textarea>
</div>';
if (current_user_can($taxonomy->cap->assign_terms)) {
$html .= '<div class="ajaxtag hide-if-no-js">
<label class="screen-reader-text" for="new-tag-' . $tax_name . '">' . $val['labels']->name . '</label>
<div class="taghint screen-reader-text" style="">' . $taxonomy->labels->add_new_item . '</div>
<p><input type="text" id="new-tag-' . $tax_name . '" name="newtag[' . $tax_name . ']" class="newtag form-input-tip" size="16" autocomplete="off" value="">
<input type="button" class="button tagadd" value="' . esc_attr('Add') . '" tabindex="3"></p>
</div>
<p class="howto">' . esc_attr($taxonomy->labels->separate_items_with_commas) . '</p>
</div>';
}
$html .= '<div class="tagchecklist"></div>';
if (current_user_can($taxonomy->cap->assign_terms)) {
$html .= '<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-' . $tax_name . '">' . $taxonomy->labels->choose_from_most_used . '</a></p>';
}
$html .= '</div>';
$html .= '<p><a href="' . admin_url('/edit-tags.php?taxonomy=' . $tax_name . '&post_type=attachment') . '">' . __('Manage', 'attachmenttaxsupp') . ' ' . $taxonomy->labels->name . '</a></p>';
$html .= wp_nonce_field('update_attachment', '_wpnonce_attachmenttaxsupp', true, false);
if ('async-upload' == $current_screen->id) {
//.........这里部分代码省略.........
示例12: post_tags_meta_box
/**
* Display post tags form fields.
*
* @since 2.6.0
*
* @param object $post
*/
function post_tags_meta_box($post, $box)
{
$tax_name = esc_attr(substr($box['id'], 8));
$taxonomy = get_taxonomy($tax_name);
$helps = isset($taxonomy->helps) ? esc_attr($taxonomy->helps) : esc_attr__('Separate tags with commas.');
$help_hint = isset($taxonomy->help_hint) ? $taxonomy->help_hint : __('Add new tag');
$help_nojs = isset($taxonomy->help_nojs) ? $taxonomy->help_nojs : __('Add or remove tags');
$help_cloud = isset($taxonomy->help_cloud) ? $taxonomy->help_cloud : __('Choose from the most used tags in %s');
$disabled = !current_user_can($taxonomy->assign_cap) ? 'disabled="disabled"' : '';
?>
<div class="tagsdiv" id="<?php
echo $tax_name;
?>
">
<div class="jaxtag">
<div class="nojs-tags hide-if-js">
<p><?php
echo $help_nojs;
?>
</p>
<textarea name="<?php
echo "tax_input[{$tax_name}]";
?>
" class="the-tags" id="tax-input[<?php
echo $tax_name;
?>
]" <?php
echo $disabled;
?>
><?php
echo esc_attr(get_terms_to_edit($post->ID, $tax_name));
?>
</textarea></div>
<?php
if (current_user_can($taxonomy->assign_cap)) {
?>
<div class="ajaxtag hide-if-no-js">
<label class="screen-reader-text" for="new-tag-<?php
echo $tax_name;
?>
"><?php
echo $box['title'];
?>
</label>
<div class="taghint"><?php
echo $help_hint;
?>
</div>
<input type="text" id="new-tag-<?php
echo $tax_name;
?>
" name="newtag[<?php
echo $tax_name;
?>
]" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
<input type="button" class="button tagadd" value="<?php
esc_attr_e('Add');
?>
" tabindex="3" />
</div>
<p class="howto"><?php
echo $helps;
?>
</p>
<?php
}
?>
</div>
<div class="tagchecklist"></div>
</div>
<?php
if (current_user_can($taxonomy->assign_cap)) {
?>
<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php
echo $tax_name;
?>
"><?php
printf($help_cloud, $box['title']);
?>
</a></p>
<?php
} else {
?>
<p><em><?php
_e('You cannot modify this Taxonomy.');
?>
</em></p>
<?php
}
}
示例13: esc_attr
<div class="nojs-tags hide-if-js">
<p><?php
echo $taxonomy->labels->add_or_remove_items;
?>
</p>
<textarea name="<?php
echo esc_attr($_wpcf_name);
?>
" rows="3" cols="20" class="the-tags" id="tax-input-<?php
echo $html_id;
?>
" <?php
disabled(!$user_can_assign_terms);
?>
><?php
echo str_replace(',', $comma . ' ', get_terms_to_edit($post->ID, $tax_name));
// textarea_escaped by esc_attr()
?>
</textarea></div>
<?php
if ($user_can_assign_terms) {
?>
<div class="ajaxtag hide-if-no-js">
<div class="taghint"><?php
echo $taxonomy->labels->add_new_item;
?>
</div>
<p><input type="text" id="new-tag-<?php
echo $html_id;
?>
" name="newtag<?php
示例14: sprintf
?>
<div id="taxonomy-<?php
echo $taxonomy;
?>
" class="tags-metabox">
<div class="hide-if-no-js">
<p><?php
echo sprintf(__('Type a tag name and press %s tab to add it.', 'Shopp'), '<abbr title="' . __('tab key', 'Shopp') . '">⇥</abbr>');
?>
</p>
</div>
<div class="nojs-tags hide-if-js">
<p><?php
echo $tax->labels->add_or_remove_items;
?>
</p>
<textarea name="<?php
echo "tax_input[{$taxonomy}]";
?>
" rows="3" cols="20" class="tags" id="tax-input-<?php
echo $taxonomy;
?>
" <?php
echo $disabled;
?>
><?php
echo esc_attr(get_terms_to_edit($Product->id, $taxonomy));
?>
</textarea></div>
</div>
示例15: bp_docs_post_tags_meta_box
/**
* Display post tags form fields. Based on WP core's post_tags_meta_box()
*
* @package BuddyPress Docs
* @since 1.0-beta
*
* @param object $post
*/
function bp_docs_post_tags_meta_box()
{
global $bp;
require_once ABSPATH . '/wp-admin/includes/taxonomy.php';
$defaults = array('taxonomy' => $bp->bp_docs->docs_tag_tax_name);
if (!isset($box['args']) || !is_array($box['args'])) {
$args = array();
} else {
$args = $box['args'];
}
extract(wp_parse_args($args, $defaults), EXTR_SKIP);
$tax_name = esc_attr($taxonomy);
$taxonomy = get_taxonomy($taxonomy);
$terms = bp_docs_is_existing_doc() ? get_terms_to_edit(get_the_ID(), $bp->bp_docs->docs_tag_tax_name) : '';
?>
<textarea name="<?php
echo "{$tax_name}";
?>
" class="the-tags" id="tax-input-<?php
echo $tax_name;
?>
"><?php
echo $terms;
// textarea_escaped by esc_attr()
?>
</textarea>
<?php
}