Support » Plugin: Ninja Forms - Modal » Please add class to the shortcode

  • It is the best way to make the link look like all the buttons in the theme.

    Fixed code:

    function ninja_forms_modal_form_shortcode( $atts )
    {
        extract( shortcode_atts( array(
            'id' => '',
            'class' => '',
            'text_link' => '',
            'image_link' => '',
        // ...etc
        ), $atts ) );
        $link = '';
        if ( $image_link ) {
            $link .= '<a href="#ninja-forms-modal-' . esc_attr( $id ) . '" rel="nf-modal:open" class="nf-modal-link '.$class.'">';
                $link .= '<img src="' . esc_attr( $image_link ) . '" />';
            $link .= '</a>';
        } elseif ( $text_link ) {
            $link .= '<a href="#ninja-forms-modal-' . esc_attr( $id ) . '" rel="nf-modal:open" class="nf-modal-link '.$class.'">';
                $link .= esc_attr( $text_link );
            $link .= '</a>';
        } else {
            return;
        }
    ...

    https://wordpress.org/plugins/ninja-forms-modal/

Viewing 3 replies - 1 through 3 (of 3 total)
  • I threw this into my functions.php file, and got the following error:

    Fatal error: Cannot redeclare ninja_forms_modal_form_shortcode() (previously declared in /home3/XXXXXX/public_html/clients/adel/wp-content/plugins/ninja-forms-modal/includes/shortcodes.php:3) in /home3/XXXXXX/public_html/clients/adel/wp-content/themes/adel/functions.php on line 60

    Do you have any ideas?

    Nevermind. I went into shortcodes.php and made the changes there. Thanks!

    Maybe better to open an issue at github or better still to submit a pull request.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Please add class to the shortcode’ is closed to new replies.