Add Custom Classes to Add Entry Button



Filename: gpnf-add-custom-classes-to-add-entry-button.php

 * Gravity Perks // Nested Forms // Add Custom Classes to Add Entry Button
 * Instruction Video:
add_filter( 'gpnf_template_args', function( $args ) {
	if ( $args['template'] === 'nested-entries' ) {
		$append_classes     = 'class-a class-b';
		$args['add_button'] = str_replace( 'gpnf-add-entry', 'gpnf-add-entry ' . $append_classes, $args['add_button'] );
	return $args;
} );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.