Form_Category_Manager::insert_into_db( array $args )

Internal method to insert a new form into the database.

Description

Parameters

$args

(array) (Required) Array of column => value pairs for the new database row.

Return

(int|false) The ID of the new form, or false on failure.

Source

File: src/db-objects/form-categories/form-category-manager.php

	protected function insert_into_db( $args ) {
		$args = $this->map_args( $args );

		if ( ! isset( $args['name'] ) || ! isset( $args['taxonomy'] ) ) {
			return false;
		}

		$name = $args['name'];
		unset( $args['name'] );

		$taxonomy = $args['taxonomy'];
		unset( $args['taxonomy'] );

		$result = wp_insert_term( $name, $taxonomy, $args );
		if ( is_wp_error( $result ) ) {
			return false;
		}

		return $result['term_id'];
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.