Advertisements

get_edit_term_link

Definition:
function get_edit_term_link( $term_id, $taxonomy, $object_type = '' ) {}

Retrieve edit term url.

Parameters

  • int $term_id: Term ID
  • string $taxonomy: Taxonomy
  • string $object_type: The object type

Defined filters

  • get_edit_term_link
    apply_filters( 'get_edit_term_link', $location, $term_id, $taxonomy, $object_type )

Source code

function get_edit_term_link( $term_id, $taxonomy, $object_type = '' ) {

	$tax = get_taxonomy( $taxonomy );

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

		return;



	$term = get_term( $term_id, $taxonomy );



	$args = array(

		'action' => 'edit',

		'taxonomy' => $taxonomy,

		'tag_ID' => $term->term_id,

	);



	if ( $object_type )

		$args['post_type'] = $object_type;



	$location = add_query_arg( $args, admin_url( 'edit-tags.php' ) );



	return apply_filters( 'get_edit_term_link', $location, $term_id, $taxonomy, $object_type );

}

9476

Advertisements

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 )

Google+ photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s

%d bloggers like this: