wpcrm_system_create_statuses

The wpcrm_system_create_statuses allows you to filter the statuses used when creating new records.

The function checks to see if the status that is being imported is valid against the array of statuses that are included in the $statuses variable that is passed to the filter. If so, the function returns the correctly formatted status, and if not it returns an empty string.

This can allow you to include statuses in your own language, or add statuses that are formatted slightly differently, yet still have the values display correctly in WP-CRM System.

Statuses included by default are:

$statuses    = array(
     'not-started'    =>    'not-started',
     'not started'    =>    'not-started',
     'in-progress'    =>    'in-progress',
     'in progress'    =>    'in-progress',
     'complete'    =>    'complete',
     'finished'    =>    'complete', 
    'on-hold'    =>    'on-hold',
     'on hold'    =>    'on-hold', 
);

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. missing a hyphen), we still want to allow the field to be updated with the correct value. In this case, we don’t care if you pass ‘in-progress’ or ‘in progress’, both will correctly return ‘in-progress’.

If you have a similar situation, perhaps with a different language or another variation to the valid statuses 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.