• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress core a2z

WordPress core a2z

WordPress core only

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / wp_add_object_terms() – Add term(s) associated with a given object.

You appear to be a bot. Output may be restricted

Description

Add term(s) associated with a given object.

Usage

$array|WP_Error = wp_add_object_terms( $object_id, $terms, $taxonomy );

Parameters

$object_id
( int ) required – The ID of the object to which the terms will be added.
$terms
( string|int|array ) required – The slug(s) or ID(s) of the term(s) to add.
$taxonomy
( array|string ) required – Taxonomy name.

Returns

array|WP_Error Term taxonomy IDs of the affected terms.

Source

File name: wordpress/wp-includes/taxonomy.php
Lines:

1 to 3 of 3
function wp_add_object_terms( $object_id, $terms, $taxonomy ) {
  return wp_set_object_terms( $object_id, $terms, $taxonomy, true );
}
 

 View on GitHub View on Trac

Published: 25th November 2019 | Last updated: 25th November 2019

Primary Sidebar

Information

Function name: wp_add_object_terms
Plugin ref: WordPress
Version: 5.6
Sourcefile: wp-includes/taxonomy.php
File ref: wp-includes/taxonomy.php
Deprecated?: No
API Letters: A,O,T,W

Footer

WP-a2z
WordPress core a2z
WordPress core only
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  core.wp-a2z.org
© Copyright WP-a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites