本文整理汇总了PHP中get_term_to_edit函数的典型用法代码示例。如果您正苦于以下问题:PHP get_term_to_edit函数的具体用法?PHP get_term_to_edit怎么用?PHP get_term_to_edit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_term_to_edit函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: link_cat_row
/**
* {@internal Missing Short Description}}
*
* @since unknown
*
* @param unknown_type $category
* @param unknown_type $name_override
* @return unknown
*/
function link_cat_row( $category, $name_override = false ) {
static $row_class = '';
if ( !$category = get_term( $category, 'link_category', OBJECT, 'display' ) )
return false;
if ( is_wp_error( $category ) )
return $category;
$default_cat_id = (int) get_option( 'default_link_category' );
$name = ( $name_override ? $name_override : $category->name );
$edit_link = "link-category.php?action=edit&cat_ID=$category->term_id";
if ( current_user_can( 'manage_categories' ) ) {
$edit = "<a class='row-title' href='$edit_link' title='" . attribute_escape(sprintf(__('Edit "%s"'), $category->name)) . "'>$name</a><br />";
$actions = array();
$actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
$actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>';
if ( $default_cat_id != $category->term_id )
$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("link-category.php?action=delete&cat_ID=$category->term_id", 'delete-link-category_' . $category->term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this category '%s'\n 'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
$action_count = count($actions);
$i = 0;
$edit .= '<div class="row-actions">';
foreach ( $actions as $action => $link ) {
++$i;
( $i == $action_count ) ? $sep = '' : $sep = ' | ';
$edit .= "<span class='$action'>$link$sep</span>";
}
$edit .= '</div>';
} else {
$edit = $name;
}
$row_class = 'alternate' == $row_class ? '' : 'alternate';
$qe_data = get_term_to_edit($category->term_id, 'link_category');
$category->count = number_format_i18n( $category->count );
$count = ( $category->count > 0 ) ? "<a href='link-manager.php?cat_id=$category->term_id'>$category->count</a>" : $category->count;
$output = "<tr id='link-cat-$category->term_id' class='iedit $row_class'>";
$columns = get_column_headers('edit-link-categories');
$hidden = get_hidden_columns('edit-link-categories');
foreach ( $columns as $column_name => $column_display_name ) {
$class = "class=\"$column_name column-$column_name\"";
$style = '';
if ( in_array($column_name, $hidden) )
$style = ' style="display:none;"';
$attributes = "$class$style";
switch ($column_name) {
case 'cb':
$output .= "<th scope='row' class='check-column'>";
if ( absint( get_option( 'default_link_category' ) ) != $category->term_id ) {
$output .= "<input type='checkbox' name='delete[]' value='$category->term_id' />";
} else {
$output .= " ";
}
$output .= "</th>";
break;
case 'name':
$output .= "<td $attributes>$edit";
$output .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
$output .= '<div class="name">' . $qe_data->name . '</div>';
$output .= '<div class="slug">' . $qe_data->slug . '</div>';
$output .= '<div class="cat_parent">' . $qe_data->parent . '</div></div></td>';
break;
case 'description':
$output .= "<td $attributes>$category->description</td>";
break;
case 'slug':
$output .= "<td $attributes>$category->slug</td>";
break;
case 'links':
$attributes = 'class="links column-links num"' . $style;
$output .= "<td $attributes>$count</td>";
}
}
$output .= '</tr>';
return $output;
}
示例2: powerpressadmin_edit_itunes_feed
//.........这里部分代码省略.........
;">
<p style="margin-top: 5px;"><strong><?php
echo __('WARNING: Changes made here are permanent. If the New Feed URL entered is incorrect, you will lose subscribers and will no longer be able to update your listing in the iTunes Store.', 'powerpress');
?>
</strong></p>
<p><strong><?php
echo __('DO NOT MODIFY THIS SETTING UNLESS YOU ABSOLUTELY KNOW WHAT YOU ARE DOING.', 'powerpress');
?>
</strong></p>
<p>
<?php
echo htmlspecialchars(sprintf(__('Apple recommends you maintain the %s tag in your feed for at least two weeks to ensure that most subscribers will receive the new New Feed URL.', 'powerpress'), '<itunes:new-feed-url>'));
?>
</p>
<p>
<?php
$FeedName = __('Main RSS2 feed', 'powerpress');
$FeedURL = get_feed_link('rss2');
if ($cat_ID) {
$category = get_category_to_edit($cat_ID);
$FeedName = sprintf(__('%s category feed', 'powerpress'), htmlspecialchars($category->name));
$FeedURL = get_category_feed_link($cat_ID);
} else {
if ($feed_slug) {
if (!empty($General['custom_feeds'][$feed_slug])) {
$FeedName = $General['custom_feeds'][$feed_slug];
} else {
$FeedName = __('Podcast', 'powerpress');
}
$FeedName = trim($FeedName) . ' ' . __('feed', 'powerpress');
$FeedURL = get_feed_link($feed_slug);
} else {
if ($FeedAttribs['type'] == 'ttid') {
$term_object = get_term_to_edit($FeedAttribs['term_id'], $FeedAttribs['taxonomy_type']);
$FeedName = sprintf(__('%s taxonomy term feed', 'powerpress'), htmlspecialchars($term_object->name));
$FeedURL = get_term_feed_link($FeedAttribs['term_id'], $FeedAttribs['taxonomy_type'], 'rss2');
}
}
}
echo sprintf(__('The New Feed URL value below will be applied to the %s (%s).', 'powerpress'), $FeedName, $FeedURL);
?>
</p>
<p style="margin-bottom: 0;">
<label style="width: 25%; float:left; display:block; font-weight: bold;"><?php
echo __('New Feed URL', 'powerpress');
?>
</label>
<input type="text" name="Feed[itunes_new_feed_url]" style="width: 55%;" value="<?php
echo esc_attr($FeedSettings['itunes_new_feed_url']);
?>
" maxlength="250" />
</p>
<p style="margin-left: 25%;margin-top: 0;font-size: 90%;">(<?php
echo __('Leave blank for no New Feed URL', 'powerpress');
?>
)</p>
<p><a href="http://www.apple.com/itunes/whatson/podcasts/specs.html#changing" target="_blank"><?php
echo __('More information regarding the iTunes New Feed URL is available here.', 'powerpress');
?>
</a></p>
<p>
<?php
if (!$cat_ID && !$feed_slug) {
if (empty($General['channels'])) {
echo sprintf(__('Please activate the \'Custom Podcast Channels\' Advanced Option to set the new-feed-url for your podcast only feed (%s)', 'powerpress'), get_feed_link('podcast'));
示例3: link_cat_row
/**
* {@internal Missing Short Description}}
*
* @since unknown
*
* @param unknown_type $category
* @param unknown_type $name_override
* @return unknown
*/
function link_cat_row($category, $name_override = false)
{
static $row_class = '';
if (!($category = get_term($category, 'link_category', OBJECT, 'display'))) {
return false;
}
if (is_wp_error($category)) {
return $category;
}
$default_cat_id = (int) get_option('default_link_category');
$name = $name_override ? $name_override : $category->name;
$edit_link = "link-category.php?action=edit&cat_ID={$category->term_id}";
if (current_user_can('manage_categories')) {
$edit = "<a class='row-title' href='{$edit_link}' title='" . esc_attr(sprintf(__('Edit “%s”'), $category->name)) . "'>{$name}</a><br />";
$actions = array();
$actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
$actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>';
if ($default_cat_id != $category->term_id) {
$actions['delete'] = "<a class='delete:the-list:link-cat-{$category->term_id} submitdelete' href='" . wp_nonce_url("link-category.php?action=delete&cat_ID={$category->term_id}", 'delete-link-category_' . $category->term_id) . "'>" . __('Delete') . "</a>";
}
$actions = apply_filters('link_cat_row_actions', $actions, $category);
$action_count = count($actions);
$i = 0;
$edit .= '<div class="row-actions">';
foreach ($actions as $action => $link) {
++$i;
$i == $action_count ? $sep = '' : ($sep = ' | ');
$edit .= "<span class='{$action}'>{$link}{$sep}</span>";
}
$edit .= '</div>';
} else {
$edit = $name;
}
$row_class = 'alternate' == $row_class ? '' : 'alternate';
$qe_data = get_term_to_edit($category->term_id, 'link_category');
$category->count = number_format_i18n($category->count);
$count = $category->count > 0 ? "<a href='link-manager.php?cat_id={$category->term_id}'>{$category->count}</a>" : $category->count;
$output = "<tr id='link-cat-{$category->term_id}' class='iedit {$row_class}'>";
$columns = get_column_headers('edit-link-categories');
$hidden = get_hidden_columns('edit-link-categories');
foreach ($columns as $column_name => $column_display_name) {
$class = "class=\"{$column_name} column-{$column_name}\"";
$style = '';
if (in_array($column_name, $hidden)) {
$style = ' style="display:none;"';
}
$attributes = "{$class}{$style}";
switch ($column_name) {
case 'cb':
$output .= "<th scope='row' class='check-column'>";
if (absint(get_option('default_link_category')) != $category->term_id) {
$output .= "<input type='checkbox' name='delete[]' value='{$category->term_id}' />";
} else {
$output .= " ";
}
$output .= "</th>";
break;
case 'name':
$output .= "<td {$attributes}>{$edit}";
$output .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
$output .= '<div class="name">' . $qe_data->name . '</div>';
$output .= '<div class="slug">' . $qe_data->slug . '</div>';
$output .= '<div class="cat_parent">' . $qe_data->parent . '</div></div></td>';
break;
case 'description':
$output .= "<td {$attributes}>{$category->description}</td>";
break;
case 'slug':
$output .= "<td {$attributes}>{$category->slug}</td>";
break;
case 'links':
$attributes = 'class="links column-links num"' . $style;
$output .= "<td {$attributes}>{$count}</td>";
break;
default:
$output .= "<td {$attributes}>";
$output .= apply_filters('manage_link_categories_custom_column', '', $column_name, $category->term_id);
$output .= "</td>";
}
}
$output .= '</tr>';
return $output;
}
示例4: add_query_arg
if ($referer = wp_get_original_referer()) {
if (false !== strpos($referer, 'edit-link-categories.php')) {
$location = $referer;
}
}
$location = add_query_arg('message', 2, $location);
wp_redirect($location);
exit;
break;
case 'edit':
$title = __('Categories');
$parent_file = 'edit.php';
$submenu_file = 'edit-link-categories.php';
require_once 'admin-header.php';
$cat_ID = (int) $_GET['cat_ID'];
$category = get_term_to_edit($cat_ID, 'link_category');
include 'edit-link-category-form.php';
include 'admin-footer.php';
exit;
break;
case 'editedcat':
$cat_ID = (int) $_POST['cat_ID'];
check_admin_referer('update-link-category_' . $cat_ID);
if (!current_user_can('manage_categories')) {
wp_die(__('Cheatin’ uh?'));
}
$location = 'edit-link-categories.php';
if ($referer = wp_get_original_referer()) {
if (false !== strpos($referer, 'edit-link-categories.php')) {
$location = $referer;
}
示例5: admin_terms
/**
* Displays the taxonomy management pages.
*
* @package webcomic
* @since 3
*/
public function admin_terms()
{
$this->domain();
global $current_user;
$wc = !empty($_REQUEST['webcomic_collection']) ? get_term($_REQUEST['webcomic_collection'], 'webcomic_collection') : get_term((int) $this->option('default_collection'), 'webcomic_collection');
$page = $_REQUEST['page'];
$pagenum = !empty($_REQUEST['pagenum']) ? $_REQUEST['pagenum'] : 1;
$hidden = get_hidden_columns('webcomic_page_' . $page);
$find = !empty($_REQUEST['s']) ? '&s=' . $_REQUEST['s'] : '';
$view = 'webcomic_collection' == $page ? '?page=' . $page : '?page=' . $page . '&webcomic_collection=' . $wc->term_id . $find;
$img_field = 'webcomic_character' == $page ? __('avatar', 'webcomic') : __('cover', 'webcomic');
$taxonomy = get_taxonomy($page);
$user_meta = current(get_user_meta($current_user->ID, 'webcomic'));
if (empty($user_meta[$page . '_per_page'])) {
$user_meta[$page . '_per_page'] = 20;
update_user_meta($current_user->ID, 'webcomic', $user_meta);
} elseif (!empty($_REQUEST[$page . '_per_page'])) {
$user_meta[$page . '_per_page'] = intval($_REQUEST[$page . '_per_page']);
update_user_meta($current_user->ID, 'webcomic', $user_meta);
}
$tpp = $user_meta[$page . '_per_page'];
if ($current_user->data->rich_editing) {
$tinymce_width = !empty($_REQUEST['subpage']) ? '460px' : '100%';
wp_tiny_mce(false, array('editor_selector' => 'webcomic_tinymce', 'width' => $tinymce_width, 'theme_advanced_buttons1' => implode(',', array('bold', 'italic', '|', 'bullist', 'numlist', 'blockquote', '|', 'link', 'unlink', '|', 'charmap', 'spellchecker', 'fullscreen', 'wp_adv')), 'theme_advanced_buttons2' => implode(',', array('formatselect', '|', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', '|', 'sub', 'sup', '|', 'removeformat', 'code'))));
}
if ('webcomic_collection' != $page && (!$wc || is_wp_error($wc))) {
?>
<div class="wrap">
<div id="icon-webcomic" class="icon32"><img src="<?php
echo $this->url . '/webcomic-includes/icon.png';
?>
" alt="icon"></div>
<h2><?php
_e('Webcomic Error', 'webcomc');
?>
</h2>
<p><?php
printf(__("Hold up: it looks like you don't have any collections! You should definitely <a href='%s'>create a collection</a> before you go any further.", 'webcomic'), admin_url('admin.php?page=webcomic_collection'));
?>
</p>
</div>
<?php
} elseif (isset($_REQUEST['subpage']) && 'edit_webcomic_term' == $_REQUEST['subpage']) {
$term = get_term_to_edit($_REQUEST['webcomic_term'], $page);
?>
<style>#screen-options-link-wrap{display:none}th img{height:auto;max-height:<?php
echo $this->option('small_h');
?>
px;max-width:<?php
echo $this->option('small_w');
?>
px;width:auto}.form-field input[type=checkbox]{width:auto}</style>
<div class="wrap">
<div id="icon-webcomic" class="icon32"><img src="<?php
echo $this->url . '/webcomic-includes/icon.png';
?>
" alt="icon"></div>
<h2><?php
echo $taxonomy->labels->edit_item;
?>
</h2>
<form action="<?php
echo $view;
?>
" method="post" enctype="multipart/form-data" class="media-upload-form">
<?php
wp_nonce_field('update_webcomic_term');
?>
<div class="media-single">
<table class="slidetoggle describe form-table">
<thead class="media-item-info">
<tr>
<th rowspan="5" class="label">
<label for="webcomic_file">
<?php
echo ucfirst($img_field);
?>
<br>
<?php
if (!empty($term->webcomic_files)) {
foreach ($term->webcomic_files['full'] as $k => $v) {
if ($term->webcomic_files['small'][$k]) {
echo $term->webcomic_files['small'][$k]['html'];
} elseif ($term->webcomic_files['medium'][$k]) {
echo $term->webcomic_files['medium'][$k]['html'];
} elseif ($term->webcomic_files['large'][$k]) {
echo $term->webcomic_files['large'][$k]['html'];
} else {
echo $v['html'];
}
}
}
?>
</label>
//.........这里部分代码省略.........