Support » Plugin: Forminator Payment, Quiz and Contact Form Plugin » Additional shortcodes to display submission number per form.

  • Resolved tskpbls

    (@tskpbls)


    Hi there!

    I would like to know if there’s a way to display the number of submissions per form in the frontend.

    for instance, imagine a form to register as a member, and a shortcode to display the following informations.

    There are [shortcodevalue] new members this month.

    Has someone worked in this already?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Dimitris – WPMU DEV Support

    (@wpmudev-support6)

    Hello there @tskpbls

    Here’s a working example of a shortcode (you can add this in the functions.php file of your child theme or in a custom mu-plugin):

    add_shortcode( 'wpmudev_forminator_entries_count', function( $atts, $content ){
    
        $atts = shortcode_atts(
            array(
                'form_id' => null
            ), $atts, 'wpmudev_forminator_entries_count' );
    
        if ( is_null( $atts['form_id'] ) ) {
            return;
        }
    
        $form_id = (int) $atts[ 'form_id' ];
        $submissions_number = Forminator_Form_Entry_Model::count_entries( $form_id );
        return $submissions_number;
    
    } );

    And then you can use this shortcode in a page:
    [wpmudev_forminator_entries_count form_id="7" ]

    Warm regards,
    Dimitris

    Hi Dimitris!

    Thanks a lot for this code! it’s working perfectly on my divi theme inside a code module.

    However I’d like to know if this code provides the number of submissions per month, or the number of submissions all times.

    Even though I used the following example on my first post here : “there are XXX nex members this month”, i’d rather use the following : “we are currently 12345 members.”

    So, switching back to zero each month is not a desired behaviour, will that happen with this shortcode?

    Thanks!

    Plugin Support Dimitris – WPMU DEV Support

    (@wpmudev-support6)

    Hello there @tskpbls

    No, there’s no limit per month, this is the total number of submissions, I’m sorry that I missed mentioning that in my previous reply. 🙂

    Warm regards,
    Dimitris

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.