wpcrm_system_create_progresses

The wpcrm_system_create_progresses allows you to filter the progress levels used when creating new records.

The function checks to see if the progress that is being imported is valid against the array of progresses that are included in the $progresses variable that is passed to the filter. If so, the function returns the correctly formatted progress, and if not it returns ‘zero’.

This can allow you to include progresses that are formatted slightly differently, yet still have the values displayed correctly in WP-CRM System.

Progresses included by default are:

$progresses    = array(
     'zero'    => 'zero',
     '0'    => 'zero',
     '0%'    => 'zero',
     '5'    => 5,
     '5%'    => 5,
     '10'    => 10,
     '10%'    => 10,
     '15'    => 15,
     '15%'    => 15,
     '20'    => 20,
     '20%'    => 20,
     '25'    => 25,
     '25%'    => 25,
     '30'    => 30,
     '30%'    => 30,
     '35'    => 35,
     '35%'    => 35,
     '40'    => 40,
     '40%'    => 40,
     '45'    => 45,
     '45%'    => 45,
     '50'    => 50,
     '50%'    => 50,
     '55'    => 55,
     '55%'    => 55,
     '60'    => 60,
     '60%'    => 60,
     '65'    => 65,
     '65%'    => 65,
     '70'    => 70,
     '70%'    => 70,
     '75'    => 75,
     '75%'    => 75,
     '80'    => 80,
     '80%'    => 80,
     '85'    => 85,
     '85%'    => 85,
     '90'    => 90,
     '90%'    => 90,
     '95'    => 95,
     '95%'    => 95,
     '100'    => 100,
     '100%'    => 100, 
);

Why are there duplicate values in the array?

The function checks the keys against the value that is being passed to the filter. If the keys are not formatted exactly correctly (i.e. including a percent sign), we still want to allow the field to be updated with the correct value. In this case, we don’t care if you pass ‘50%’ or ’50’, both will correctly return ’50’.

If you have a similar situation, perhaps with a different variation to the valid progresses that are not included above, you can add or edit this array to include your variation. The only requirement is that the value returned is one of the existing values shown in the array above.