Advertisements

wp_set_link_cats

Definition:
function wp_set_link_cats( $link_id = 0, $link_categories = array() {}

Update link with the specified link categories.

Parameters

  • int $link_id: ID of link to update
  • array $link_categories: Array of categories to

Source code

function wp_set_link_cats( $link_id = 0, $link_categories = array() ) {

	// If $link_categories isn't already an array, make it one:

	if ( !is_array( $link_categories ) || 0 == count( $link_categories ) )

		$link_categories = array( get_option( 'default_link_category' ) );



	$link_categories = array_map( 'intval', $link_categories );

	$link_categories = array_unique( $link_categories );



	wp_set_object_terms( $link_id, $link_categories, 'link_category' );



	clean_bookmark_cache( $link_id );

}

4105

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: