edit_term_link

Definition:
function edit_term_link( $link = '', $before = '', $after = '', $term = null, $echo = true ) {}

Display or retrieve edit term link with formatting.

Parameters

  • string $link: Optional. Anchor text.
  • string $before: Optional. Display before edit link.
  • string $after: Optional. Display after edit link.
  • object $term: Term object
  • $echo

Return values

returns:HTML content.

Defined filters

  • edit_term_link
    apply_filters( 'edit_term_link', $link, $term->term_id )

Source code

function edit_term_link( $link = '', $before = '', $after = '', $term = null, $echo = true ) {

	if ( is_null( $term ) ) {

		$term = get_queried_object();

	}



	$tax = get_taxonomy( $term->taxonomy );

	if ( !current_user_can($tax->cap->edit_terms) )

		return;



	if ( empty( $link ) )

		$link = __('Edit This');



	$link = '<a href="' . get_edit_term_link( $term->term_id, $term->taxonomy ) . '" title="' . $link . '">' . $link . '</a>';

	$link = $before . apply_filters( 'edit_term_link', $link, $term->term_id ) . $after;



	if ( $echo )

		echo $link;

	else

		return $link;

}

9269

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: