You appear to be a bot. Output may be restricted
Description
Create a term and returns it as an object.
Usage
$WP_Term|WP_Error|null = WP_UnitTest_Factory_For_Term::create_and_get( $args, $generation_definitions );
Parameters
- $args
- ( array ) optional – Array or string of arguments for inserting a term.
- $generation_definitions
- ( null ) optional – The default values.
Returns
WP_Term|WP_Error|null WP_Term on success. WP_Error if taxonomy does not exist. Null for miscellaneous failure.
Source
File name: wordpress-develop-tests/phpunit/includes/factory/class-wp-unittest-factory-for-term.php
Lines:
1 to 10 of 10
public function create_and_get( $args = array(), $generation_definitions = null ) { $term_id = $this->create( $args, $generation_definitions ); if ( is_wp_error( $term_id ) ) { return $term_id; } $taxonomy = isset( $args['taxonomy'] ) ? $args['taxonomy'] : $this->taxonomy; return get_term( $term_id, $taxonomy ); }