• Resolved MarcosAlexandre

    (@marcosalexandre)


    Minimum character ID

    Hello, congratulations on the plugin!
    How can we use it to display leading zeros, for example:
    0001, 0002, 0003 … instead of 1, 2, 3?

    I need the ID to have 4 digits, because we are building a protocol with the following format:
    YYYYMMXXXX

    Where “XXXX” would be the ID, but today it prints only 1 digit, getting:

    YYYYMMX

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter MarcosAlexandre

    (@marcosalexandre)

    Can anyone help?

    Plugin Author tsjippy

    (@tsjippy)

    Sorry I did not build in that function but you could at it yourself if you now pho or js

    Plugin Author tsjippy

    (@tsjippy)

    I just added a filter:

    You can filter the value using the cf7_submission_id_filter.
    To add leading zeros for example, just put the code below in your functions.php
    
    	add_filter('cf7_submission_id_filter', 'custom_cf7_submission_id_filter');
    	function custom_cf7_submission_id_filter($val){
    		return sprintf("%04d", $val);
    	}
    Thread Starter MarcosAlexandre

    (@marcosalexandre)

    Congratulations!

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Minimum character ID’ is closed to new replies.