PHP 클래스 WPCC\Component\Factory\Term

부터: 1.0.0
상속: extends WPCC\Component\Factory
파일 보기 프로젝트 열기: 10up/wp-codeception

보호된 프로퍼티들

프로퍼티 타입 설명
$_taxonomy string The taxonomy name.

공개 메소드들

메소드 설명
__construct ( string $taxonomy = null ) Constructor.
addPostTerms ( integer $post_id, array $terms, string $taxonomy, boolean $append = true ) : array Adds terms to a post.
getObjectById ( integer $term_id ) : mixed Returns generated term by id.

보호된 메소드들

메소드 설명
_createObject ( array $args ) : integer | WP_Error Generates a new term.
_deleteObject ( integer $term_id ) : boolean Deletes previously generated term.
_updateObject ( mixed $term, array $fields ) : mixed Updates generated term.

메소드 상세

__construct() 공개 메소드

Constructor.
부터: 1.0.0
public __construct ( string $taxonomy = null )
$taxonomy string The taxonomy name.

_createObject() 보호된 메소드

Generates a new term.
부터: 1.0.0
protected _createObject ( array $args ) : integer | WP_Error
$args array The array of arguments to use during a new term creation.
리턴 integer | WP_Error The newly created term's ID on success, otherwise a WP_Error object.

_deleteObject() 보호된 메소드

Deletes previously generated term.
부터: 1.0.0
protected _deleteObject ( integer $term_id ) : boolean
$term_id integer The term id to delete.
리턴 boolean TRUE on success, otherwise FALSE.

_updateObject() 보호된 메소드

Updates generated term.
부터: 1.0.0
protected _updateObject ( mixed $term, array $fields ) : mixed
$term mixed The term id to update.
$fields array The array of fields to update.
리턴 mixed Updated term ID on success, otherwise a WP_Error object.

addPostTerms() 공개 메소드

Adds terms to a post.
부터: 1.0.0
public addPostTerms ( integer $post_id, array $terms, string $taxonomy, boolean $append = true ) : array
$post_id integer The post id to add terms to.
$terms array The array of terms to add.
$taxonomy string The taxonomy name of terms.
$append boolean Determines whether to add or replace terms.
리턴 array The array of affected term IDs.

getObjectById() 공개 메소드

Returns generated term by id.
부터: 1.0.0
public getObjectById ( integer $term_id ) : mixed
$term_id integer The term id.
리턴 mixed The generated term on success, otherwise NULL or a WP_Error object.

프로퍼티 상세

$_taxonomy 보호되어 있는 프로퍼티

The taxonomy name.
부터: 1.0.0
protected string $_taxonomy
리턴 string