• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_term_to_edit函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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&nbsp;Edit') . '</a>';
		if ( $default_cat_id != $category->term_id )
			$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("link-category.php?action=delete&amp;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 .= "&nbsp;";
				}
				$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;
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:89,代码来源:template.php


示例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'));
开发者ID:ajay786singh,项目名称:emc,代码行数:67,代码来源:powerpressadmin-editfeed.php


示例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&amp;cat_ID={$category->term_id}";
    if (current_user_can('manage_categories')) {
        $edit = "<a class='row-title' href='{$edit_link}' title='" . esc_attr(sprintf(__('Edit &#8220;%s&#8221;'), $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&nbsp;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&amp;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 .= "&nbsp;";
                }
                $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;
}
开发者ID:bluedanbob,项目名称:wordpress,代码行数:92,代码来源:template.php


示例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&#8217; uh?'));
     }
     $location = 'edit-link-categories.php';
     if ($referer = wp_get_original_referer()) {
         if (false !== strpos($referer, 'edit-link-categories.php')) {
             $location = $referer;
         }
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:31,代码来源:link-category.php


示例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']) ? '&amp;s=' . $_REQUEST['s'] : '';
        $view = 'webcomic_collection' == $page ? '?page=' . $page : '?page=' . $page . '&amp;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>
//.........这里部分代码省略.........
开发者ID:nimbuschick,项目名称:webcomic,代码行数:101,代码来源:admin.php



注:本文中的get_term_to_edit函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_terms函数代码示例发布时间:2022-05-15
下一篇:
PHP get_term_meta函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap