lp__save_form_fields( $taxonomy, $args )

This function is used to save the form fields. This function takes parameters such as the taxonomy and field group arguments to configure and create form field.


Plugin


Namespace

Launchpad\Fields


Parameters

array

$taxonomy

Taxonomy where the field are rendered

array

$args

Field group arguments


Return

void


Source

File: \includes\lp-field-group-functions.php

function lp__save_form_fields( $taxonomy, $args ){
    add_action( "created_{$taxonomy}", function( $term_id, $tt_id ) use( $taxonomy, $args ){
        /**
         * Hook: lp__save_form_field/{field_group_id}
         * 
         * Fires after new term of specific taxonomy is created.
         * 
         * Use this to hook functionality when creating a new form field.
         *
         * @since   1.5.20
         */
        do_action( "lp__save_form_field/{$args['id']}", $term_id, $tt_id, false );
    }, 10, 2);
    add_action( "edited_{$taxonomy}", function( $term_id, $tt_id ) use( $taxonomy, $args ){
        /**
         * Hook: lp__save_form_field/{field_group_id}
         * 
         * Fires after a term of specific taxonomy is updated.
         * 
         * Use this to hook functionality when creating a new form field.
         *
         * @since   1.5.20
         */
        do_action( "lp__save_form_field/{$args['id']}", $term_id, $tt_id, true );
    }, 10, 2);
}