本文整理汇总了PHP中edit_term_link函数的典型用法代码示例。如果您正苦于以下问题:PHP edit_term_link函数的具体用法?PHP edit_term_link怎么用?PHP edit_term_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了edit_term_link函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: soya_wp_check_input
function soya_wp_check_input($term_id)
{
$term = get_term($term_id, 'soya-range');
$term_depth = soya_get_term_custom_field($term_id, 'soya_depth_meta');
//$options = soya_get_term_range($term_id, $term_depth);
echo '<label>' . $term->name . ' ' . edit_term_link('edit ' . $term->name, '', '', $term, false) . '</label><br>';
for ($index = 1; $index <= $term_depth; $index++) {
echo '<input type="checkbox" name="' . $term->slug . '_' . $index . '[]" value="" id="' . $term->slug . '_' . $index . '">';
}
}
示例2: edit_tag_link
/**
* Display or retrieve edit tag link with formatting.
*
* @since 2.7.0
*
* @param string $link Optional. Anchor text.
* @param string $before Optional. Display before edit link.
* @param string $after Optional. Display after edit link.
* @param object $tag Tag object.
*/
function edit_tag_link($link = '', $before = '', $after = '', $tag = null)
{
$link = edit_term_link($link, '', '', $tag, false);
/**
* Filter the anchor tag for the edit link for a tag (or term in another taxonomy).
*
* @since 2.7.0
*
* @param string $link The anchor tag for the edit link.
*/
echo $before . apply_filters('edit_tag_link', $link) . $after;
}
示例3: edit_tag_link
/**
* Display or retrieve edit tag link with formatting.
*
* @since 2.7.0
*
* @param string $link Optional. Anchor text.
* @param string $before Optional. Display before edit link.
* @param string $after Optional. Display after edit link.
* @param int|object $tag Tag object or ID
* @return string HTML content.
*/
function edit_tag_link($link = '', $before = '', $after = '', $tag = null)
{
$link = edit_term_link($link, '', '', false, $tag);
echo $before . apply_filters('edit_tag_link', $link) . $after;
}
示例4: column_category
public function column_category($post)
{
/* Get the genres for the post. */
$category = get_the_terms($post->ID, ANSPRESS_CAT_TAX);
/* If terms were found. */
if (!empty($category)) {
$out = array();
/* Loop through each term, linking to the 'edit posts' page for the specific term. */
foreach ($category as $cat) {
$out[] = edit_term_link($cat->name, '', '', $cat, false);
}
/* Join the terms, separating them with a comma. */
return join(', ', $out);
} else {
return __('--', 'anspress-question-answer');
}
}
示例5: custom_columns_value
public function custom_columns_value($column)
{
global $post;
if ('asker' == $column || 'answerer' == $column) {
echo get_avatar(get_the_author_meta('user_email'), 40);
} elseif (ANSPRESS_CAT_TAX == $column) {
/* Get the genres for the post. */
$category = get_the_terms($post->ID, ANSPRESS_CAT_TAX);
/* If terms were found. */
if (!empty($category)) {
$out = array();
/* Loop through each term, linking to the 'edit posts' page for the specific term. */
foreach ($category as $cat) {
$out[] = edit_term_link($cat->name, '', '', $cat, false);
}
/* Join the terms, separating them with a comma. */
echo join(', ', $out);
} else {
_e('--');
}
} elseif (ANSPRESS_TAG_TAX == $column) {
/* Get the genres for the post. */
$terms = get_the_terms($post->ID, ANSPRESS_TAG_TAX);
/* If terms were found. */
if (!empty($terms)) {
$out = array();
/* Loop through each term, linking to the 'edit posts' page for the specific term. */
foreach ($terms as $term) {
$out[] = sprintf('<a href="%s">%s</a>', esc_url(add_query_arg(array('post_type' => $post->post_type, ANSPRESS_TAG_TAX => $term->slug), 'edit.php')), esc_html(sanitize_term_field('name', $term->name, $term->term_id, ANSPRESS_TAG_TAX, 'display')));
}
/* Join the terms, separating them with a comma. */
echo join(', ', $out);
} else {
_e('No Tags');
}
} elseif ('answers' == $column) {
/* Get the genres for the post. */
$an_count_args = array('post_type' => 'answer', 'post_status' => 'publish', 'post_parent' => $post->ID, 'showposts' => -1);
$a_count = count(get_posts($an_count_args));
/* If terms were found. */
if (!empty($a_count)) {
echo '<a class="ans-count" title="' . $a_count . __('answers', 'ap') . '" href="' . esc_url(add_query_arg(array('post_type' => 'answer', 'post_parent' => $post->ID), 'edit.php')) . '">' . $a_count . '</a>';
} else {
echo '<a class="ans-count" title="0' . __('answers', 'ap') . '">0</a>';
}
} elseif ('parent_question' == $column) {
echo '<a class="parent_question" href="' . esc_url(add_query_arg(array('post' => $post->post_parent, 'action' => 'edit'), 'post.php')) . '"><strong>' . get_the_title($post->post_parent) . '</strong></a>';
} elseif ('status' == $column) {
echo '<span class="question-status">' . ap_get_question_label() . '</span>';
} elseif ('vote' == $column) {
echo '<span class="vote-count' . ($post->flag ? ' zero' : '') . '">' . $post->net_vote . '</span>';
} elseif ('flag' == $column) {
echo '<span class="flag-count' . ($post->flag ? ' flagged' : '') . '">' . $post->flag . '</span>';
}
}
示例6: custom_columns_value
public function custom_columns_value($column)
{
global $post;
if (!($post->post_type != 'question' || $post->post_type != 'answer')) {
return $column;
}
if ('asker' == $column || 'answerer' == $column) {
echo get_avatar(get_the_author_meta('user_email'), 40);
} elseif ('status' == $column) {
echo '<span class="post-status">';
if ('private_post' == $post->post_status) {
echo __('Private', 'ap');
} elseif ('closed' == $post->post_status) {
echo __('Closed', 'ap');
} elseif ('moderate' == $post->post_status) {
echo __('Moderate', 'ap');
} elseif ('private' == $post->post_status) {
echo __('Private', 'ap');
} elseif ('darft' == $post->post_status) {
echo __('Draft', 'ap');
} elseif ('pending' == $post->post_status) {
echo __('Pending', 'ap');
} elseif ('trash' == $post->post_status) {
echo __('Trash', 'ap');
} else {
echo __('Open', 'ap');
}
echo '</span>';
} elseif ('question_category' == $column && taxonomy_exists('question_category')) {
$category = get_the_terms($post->ID, 'question_category');
if (!empty($category)) {
$out = array();
foreach ($category as $cat) {
$out[] = edit_term_link($cat->name, '', '', $cat, false);
}
echo join(', ', $out);
} else {
_e('--');
}
} elseif ('question_tag' == $column && taxonomy_exists('question_tag')) {
$terms = get_the_terms($post->ID, 'question_tag');
if (!empty($terms)) {
$out = array();
foreach ($terms as $term) {
$out[] = sprintf('<a href="%s">%s</a>', esc_url(add_query_arg(array('post_type' => $post->post_type, 'question_tag' => $term->slug), 'edit.php')), esc_html(sanitize_term_field('name', $term->name, $term->term_id, 'question_tag', 'display')));
}
echo join(', ', $out);
} else {
_e('--', 'ap');
}
} elseif ('answers' == $column) {
$a_count = ap_count_answer_meta();
/* If terms were found. */
if (!empty($a_count)) {
echo '<a class="ans-count" title="' . $a_count . __('answers', 'ap') . '" href="' . esc_url(add_query_arg(array('post_type' => 'answer', 'post_parent' => $post->ID), 'edit.php')) . '">' . $a_count . '</a>';
} else {
echo '<a class="ans-count" title="0' . __('answers', 'ap') . '">0</a>';
}
} elseif ('parent_question' == $column) {
echo '<a class="parent_question" href="' . esc_url(add_query_arg(array('post' => $post->post_parent, 'action' => 'edit'), 'post.php')) . '"><strong>' . get_the_title($post->post_parent) . '</strong></a>';
} elseif ('vote' == $column) {
$vote = get_post_meta($post->ID, ANSPRESS_VOTE_META, true);
echo '<span class="vote-count' . ($vote ? ' zero' : '') . '">' . $vote . '</span>';
} elseif ('flag' == $column) {
$total_flag = ap_post_flag_count();
echo '<span class="flag-count' . ($total_flag ? ' flagged' : '') . '">' . $total_flag . '</span>';
}
}
示例7: show_menu_titles_in_menu_item_list
function show_menu_titles_in_menu_item_list($post)
{
global $wp_list_table;
static $last_term_id = false;
$term = $this->get_menu_item_menu_leaf($post->ID);
if (false !== $last_term_id && $last_term_id === $term->term_id) {
return;
}
$last_term_id = $term->term_id;
$parent_count = 0;
$current_term = $term;
while ($current_term->parent) {
$parent_count++;
$current_term = get_term($current_term->parent, self::MENU_TAX);
}
$non_order_column_count = $wp_list_table->get_column_count() - 1;
$screen = get_current_screen();
$url = admin_url($screen->parent_file);
$up_url = add_query_arg(array('action' => 'move-menu-up', 'term_id' => (int) $term->term_id), wp_nonce_url($url, 'nova_move_menu_up_' . $term->term_id));
$down_url = add_query_arg(array('action' => 'move-menu-down', 'term_id' => (int) $term->term_id), wp_nonce_url($url, 'nova_move_menu_down_' . $term->term_id));
?>
<tr class="no-items menu-label-row" data-term_id="<?php
echo esc_attr($term->term_id);
?>
">
<td class="colspanchange" colspan="<?php
echo (int) $non_order_column_count;
?>
">
<h3><?php
echo str_repeat(' — ', (int) $parent_count);
if (!is_wp_error($term)) {
echo esc_html(sanitize_term_field('name', $term->name, $term->term_id, self::MENU_TAX, 'display'));
edit_term_link(__('edit', 'jetpack'), '<span class="edit-nova-section"><span class="dashicon dashicon-edit"></span>', '</span>', $term);
} else {
_e('Uncategorized', 'jetpack');
}
?>
</h3>
</td>
<td>
<?php
if (!is_wp_error($term)) {
?>
<a class="nova-move-menu-up" title="<?php
esc_attr_e('Move menu section up', 'jetpack');
?>
" href="<?php
echo esc_url($up_url);
?>
"><?php
esc_html_e('UP', 'jetpack');
?>
</a>
<br />
<a class="nova-move-menu-down" title="<?php
esc_attr_e('Move menu section down', 'jetpack');
?>
" href="<?php
echo esc_url($down_url);
?>
"><?php
esc_html_e('DOWN', 'jetpack');
?>
</a>
<?php
}
?>
</td>
</tr>
<?php
}
示例8: edit_category_link
/**
* Get a link to the admin area's category page if current user is allowed
* to 'manage_categories'. If the `$id` argument is not set, the current category
* of an archive page will be fetched, if so.
*
* @param string $link
* @param string $before
* @param string $after
* @param null $id
* @param bool $echo
* @return null|string|void
*/
function edit_category_link($link = '', $before = '', $after = '', $id = null, $echo = true)
{
if (current_user_can('manage_categories')) {
if (is_null($id)) {
$id = get_cat_id(single_cat_title('', false));
}
if ($id) {
$category = get_term($id, 'category');
return edit_term_link($link, $before, $after, $category, $echo);
}
}
return null;
}
示例9: cp_match_cats
function cp_match_cats($form_cats)
{
$out = array();
$terms = get_terms(APP_TAX_CAT, array('include' => $form_cats, 'hide_empty' => false));
if ($terms) {
foreach ($terms as $term) {
$out[] = edit_term_link($term->name, '', '', $term, false);
}
}
return join(', ', $out);
}
示例10: get_archive_crumb
/**
* Return archive breadcrumb. Private
*
* @since 1.5.0
*
* @global mixed $wp_query The page query object
* @global mixed $wp_locale The locale object, used for getting the
* auto-translated name of the month for month or day archives
* @return string HTML markup
*/
function get_archive_crumb()
{
global $wp_query, $wp_locale;
if (is_category()) {
$crumb = $this->args['labels']['category'] . $this->get_term_parents(get_query_var('cat'), 'category');
$crumb .= edit_term_link(__('(Edit)', 'genesis'), ' ', '', null, false);
} elseif (is_tag()) {
$crumb = $this->args['labels']['tag'] . single_term_title('', false);
$crumb .= edit_term_link(__('(Edit)', 'genesis'), ' ', '', null, false);
} elseif (is_tax()) {
$term = $wp_query->get_queried_object();
$crumb = $this->args['labels']['tax'] . $this->get_term_parents($term->term_id, $term->taxonomy);
$crumb .= edit_term_link(__('(Edit)', 'genesis'), ' ', '', null, false);
} elseif (is_year()) {
$crumb = $this->args['labels']['date'] . get_query_var('year');
} elseif (is_month()) {
$crumb = $this->get_breadcrumb_link(get_year_link(get_query_var('year')), sprintf(__('View archives for %s', 'genesis'), get_query_var('year')), get_query_var('year'), $this->args['sep']);
$crumb .= $this->args['labels']['date'] . single_month_title(' ', false);
} elseif (is_day()) {
$crumb = $this->get_breadcrumb_link(get_year_link(get_query_var('year')), sprintf(__('View archives for %s', 'genesis'), get_query_var('year')), get_query_var('year'), $this->args['sep']);
$crumb .= $this->get_breadcrumb_link(get_month_link(get_query_var('year'), get_query_var('monthnum')), sprintf(__('View archives for %s %s', 'genesis'), $wp_locale->get_month(get_query_var('monthnum')), get_query_var('year')), $wp_locale->get_month(get_query_var('monthnum')), $this->args['sep']);
$crumb .= $this->args['labels']['date'] . get_query_var('day') . date('S', mktime(0, 0, 0, 1, get_query_var('day')));
} elseif (is_author()) {
$crumb = $this->args['labels']['author'] . esc_html($wp_query->queried_object->display_name);
} elseif (is_post_type_archive()) {
$crumb = $this->args['labels']['post_type'] . esc_html(post_type_archive_title('', false));
}
return apply_filters('genesis_archive_crumb', $crumb, $this->args);
}
示例11: mf2012_custom_columns
function mf2012_custom_columns($column, $post_id)
{
switch ($column) {
case 'name':
edit_post_link(get_the_title($post_id), '', '', $post_id);
break;
case 'theme':
case 'format':
case 'organizer':
case 'location':
$terms = wp_get_post_terms($post_id, $column);
$items = array();
foreach ($terms as $term) {
$items[] = edit_term_link($term->name, '', '', $term, false);
}
if (empty($items)) {
$items[] = '<em>Undefined</em>';
}
echo implode(', ', $items);
break;
case 'time':
$start = get_post_meta($post_id, 'start', true);
$end = get_post_meta($post_id, 'end', true);
if (!empty($start) && !empty($end)) {
$start = strtotime($start);
$end = strtotime($end);
echo date('H:i - ', $start);
echo date('H:i (D. jS)', $end);
}
break;
}
}
示例12: term_meta_notice
/**
* For 4.4, output a notice explaining that old term options can be updated to term_meta.
* Options are to update all terms or to ignore, and do by hand.
* @since 2.4.0
*/
protected function term_meta_notice()
{
$screen = get_current_screen();
if ('appearance_page_displayfeaturedimagegenesis' !== $screen->id) {
return;
}
$updated_terms = get_option('displayfeaturedimagegenesis_updatedterms', false);
if ($updated_terms) {
return;
}
$rows = $this->term_option_query;
if (!$rows) {
update_option('displayfeaturedimagegenesis_updatedterms', true);
return;
}
$message = sprintf('<p>%s</p>', __('WordPress 4.4 introduces term metadata for categories, tags, and other taxonomies. This is your opportunity to optionally update all impacted terms on your site to use the new metadata.', 'display-featured-image-genesis'));
$message .= sprintf('<p>%s</p>', __('This <strong>will modify</strong> your database (potentially many entries at once), so if you\'d rather do it yourself, you can. Here\'s a list of the affected terms:', 'display-featured-image-genesis'));
$message .= '<ul style="margin-left:24px;list-style-type:disc;">';
foreach ($rows as $row) {
$term_id = str_replace('displayfeaturedimagegenesis_', '', $row);
$term = get_term((int) $term_id);
if (!is_wp_error($term) && !is_null($term)) {
$message .= edit_term_link($term->name, '<li>', '</li>', $term, false);
}
}
$message .= '</ul>';
$message .= sprintf('<p>%s</p>', __('To get rid of this notice, you can 1) update your terms by hand; 2) click the update button (please check your terms afterward); or 3) click the dismiss button.', 'display-featured-image-genesis'));
$faq = sprintf(__('For more information, please visit the plugin\'s <a href="%s" target="_blank">Frequently Asked Questions</a> on WordPress.org.', 'display-featured-image-genesis'), esc_url('https://wordpress.org/plugins/display-featured-image-genesis/faq/'));
$message .= sprintf('<p>%s</p>', $faq);
echo '<div class="updated">' . wp_kses_post($message);
echo '<form action="" method="post">';
wp_nonce_field('displayfeaturedimagegenesis_metanonce', 'displayfeaturedimagegenesis_metanonce', false);
$buttons = array(array('value' => __('Update My Terms', 'display-featured-image-genesis'), 'name' => 'displayfeaturedimagegenesis_termmeta', 'class' => 'button-primary'), array('value' => __('Dismiss (Not Recommended)', 'display-featured-image-genesis'), 'name' => 'displayfeaturedimagegenesis_termmetadismiss', 'class' => 'button-secondary'));
echo '<p>';
foreach ($buttons as $button) {
printf('<input type="submit" class="%s" name="%s" value="%s" style="margin-right:12px;" />', esc_attr($button['class']), esc_attr($button['name']), esc_attr($button['value']));
}
echo '</p>';
echo '</form>';
echo '</div>';
}
开发者ID:robincornett,项目名称:display-featured-image-genesis,代码行数:46,代码来源:class-displayfeaturedimagegenesis-settings.php
示例13: the_title
?>
<div class="row">
<div class="col-xs-12 col-lg-8 col-lg-offset-2">
<div class="row">
<h1><?php
the_title();
?>
</h1>
<?php
the_content();
?>
</div>
</div>
</div>
<?php
}
} else {
if (is_user_logged_in()) {
$warning = 'Wählen Sie ' . edit_term_link('hier', '', '', $term_object, false) . ' eine Seite aus, die über der Preis-Kategorie-Übersicht angezeigt werden soll.';
echo $warning;
}
}
get_template_part('template-parts/content', 'preis-uebersicht');
// Restore original Post Data
wp_reset_postdata();
}
?>
</main><!-- #main -->
<?php
get_footer();