edit_tag_link() - WordPress 函数参考中文文档

返回介绍

edit_tag_link()

发布于 2017-09-10 字数2604 浏览 853 评论 0

edit_tag_link( string $link = '',  string $before = '',  string $after = '',  WP_Term $tag = null )

Displays or retrieves the edit link for a tag with formatting.


描述


参数

$link

(string)
(Optional)
Anchor text.

Default value: ”

$before

(string)
(Optional)
Display before edit link.

Default value: ”

$after

(string)
(Optional)
Display after edit link.

Default value: ”

$tag

(WP_Term)
(Optional)
Term object. If null, the queried object will be inspected.

Default value: null


源代码

File: wp-includes/link-template.php

function edit_tag_link( $link = '', $before = '', $after = '', $tag = null ) {
	$link = edit_term_link( $link, '', '', $tag, false );

	/**
	 * Filters 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;
}

更新日志

Version 描述
2.7.0 Introduced.

相关函数

Uses

  • wp-includes/link-template.php:
    edit_term_link()
  • wp-includes/link-template.php:
    edit_tag_link
  • wp-includes/plugin.php:
    apply_filters()

User Contributed Notes

  1. Skip to note content

    You must log in to vote on the helpfulness of this noteVote results for this note: 0You must log in to vote on the helpfulness of this note

    Contributed by Codex

    Default Usage

    Displays edit tag link using defaults.

    
    <?php edit_tag_link(); ?>
    
  2. Displays Edit Tag in Paragraph Tag

    Displays edit tag link, with link text “edit tag”, in a paragraph (<p>) tag.

    
    <?php edit_tag_link('edit tag', '<p>', '</p>'); ?>
    

上一篇:edit_post_link()

下一篇:edit_term_link()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!