Calculated Fields for ACF 1.3.0

calculated fields for advanced custom fields 1.3.0

As the last effort of an otherwise busy week, we’re releasing Calculated Fields for ACF version 1.3.0 today. As usual the plugin is available on our own site as well as on the official WordPress plugin repository.

New features

This new version have two features that both focus on better output formatting.

Number format

PHP has built in support for formatting numbers in a wide variety of ways. For example, you may want to format prices to make sure they always show up with only two decimal places instead something like $4.5 or $4.539999. To handle all imaginable types of numeric formatting, PHP has its own little formatting language for this using the sprintf() function.

The new version of Calculated Fields for ACF lets you take advantage of this PHP feature by offering the new Number format field. This means that you can format the output pretty much however you want. Fixed decimal places? Converted to an integer? Formatted as a currency? Almost anything goes, described in greater detail here.

Blank if zero

The other formatting option is to leave the output completely blank (empty string)) if the numeric value equals zero.

This has been a very common support request from users that use formulas to populate values in a table. Filling all cells with a litteral zero make the output much harder to read. This new feature fixes that.

Fixed issues

  • Bug: “empty needle” – fix issue where a PHP warning for “empty needle” would be emitted to the PHP error log when using complex field groups
  • Fix various PHP warnings when activating on multi site
  • Fixes a scripting conflict with WooCommerce

Other updates

In this version of the plugin we are bumping the minimum PHP version from 5.6 to 7.0. WooCommerce made this jump earlier in 2020 and we think it is time to follow suit.

To the best of our knowledge we haven’t added any code that will make this plugin stop working on PHP 5.6. But we have stopped testing on PHP 5.6 and we will not provide any support for users on PHP 5.6.

Leave a Reply

Your email address will not be published.