Form::duplicate_terms_for_form( int $form_id )

Duplicates all taxonomy terms for this form and applies them to another given form.

Description

See also

Parameters

$form_id

(int) (Required) New form ID to apply the taxonomy terms to.

Source

File: src/db-objects/forms/form.php

	protected function duplicate_terms_for_form( $form_id ) {
		$taxonomies = get_object_taxonomies( get_post( $this->original->ID ), 'names' );
		foreach ( $taxonomies as $taxonomy ) {
			$terms = wp_get_object_terms( $this->original->ID, $taxonomy, array( 'fields' => 'ids' ) );
			wp_set_object_terms( $form_id, $terms, $taxonomy );
		}
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.