Filter: wr_form_add_scripts

Allows you to add scripts to a form.

 

 

 

Example: Add fonts to pdf builder

add_action( 'wr_form_add_scripts', array( $this, 'add_script_to_form' ), 10, 2 );

public function add_script_to_form( array $scripts, Form $form ): array {
	if ( $form->get_identifier() === "identifier" ) {
		$scripts[] = ScriptObject::create_by_file( 'path/script.js' );
	}

	return $scripts;
}
0
    0
    Your Cart
    Your cart is emptyReturn to Shop