Advertisements

get_terms_to_edit

Definition:
function get_terms_to_edit( $post_id, $taxonomy = 'post_tag' ) {}

Parameters

  • unknown_type $post_id
  • $taxonomy

Defined filters

  • terms_to_edit
    apply_filters( 'terms_to_edit', $tags_to_edit, $taxonomy )

Source code

function get_terms_to_edit( $post_id, $taxonomy = 'post_tag' ) {

	$post_id = (int) $post_id;

	if ( !$post_id )

		return false;



	$tags = wp_get_post_terms($post_id, $taxonomy, array());



	if ( !$tags )

		return false;



	if ( is_wp_error($tags) )

		return $tags;



	foreach ( $tags as $tag )

		$tag_names[] = $tag->name;

	$tags_to_edit = join( ',', $tag_names );

	$tags_to_edit = esc_attr( $tags_to_edit );

	$tags_to_edit = apply_filters( 'terms_to_edit', $tags_to_edit, $taxonomy );



	return $tags_to_edit;

}

1751

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: