- 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細)
Function Reference/wp remove object terms
提供: WordPress Codex 日本語版
Description
Remove term(s) associated with a given object.
Parameters
- $object_id
- (int) (必須) The ID of the object from which the terms will be removed.
- 初期値: なし
- $terms
- (mixed) (必須) The slug(s) or ID(s) of the term(s) to remove. Accepts array, int or string.
- 初期値: なし
- $taxonomy
- (mixed) (必須) The taxonomy name.
- 初期値: なし
Return
- (mixed)
- True on success, false or WP_Error on failure.
Usage
%%% <?php wp_remove_object_terms( $id, $terms, $taxonomy ); ?> %%%
Example
Remove tag from post.
wp_remove_object_terms( $post_id, 'sweet', 'post_tag' );
Change Log
- Since: 3.6.0
Source File
wp_remove_object_terms() is located in wp-includes/taxonomy.php
.