WordPress OSINT, maintenance or security needs? Reach out!
TLDWP

Plugin: calculated-fields-for-acf (Used by 2 domains)

Calculated fields for ACF

Adds a formula fields ot Advanced Custom Fields that allows you to perform simple math based on field values. Calculations are updated dynamically via ajax while editing a post on the backend post editor as well as on front end forms.

Requirements

Calculated fields requires Advanced Custom Fields 5.0 or later and works with Pro as well as the standard version.

Frontend forms

Beginning in version 1.2.3, Calculated fields for ACF supports frontend forms created using the acf_form() function (built in to Advanced Custom Fields).

Formulas

Calculated fields adds a new setting “Formula” to the the ACF field editor. Formulas supports referring to other fields in the same Field group using the field name. If a formula is added to a sub field inside a repeater field, the name refers to another sub field in the same repeater.

A sub field inside a repeater field can also refer to a parent field using the “parent.”” prefix.

A formula can contain the basic mathematical operations: plus (+), minus (-), multiply (*), division (/) and power of (^). Formulas can also contains functions like sin, cos, arcsin, log, ln, sqrt, abs. Parentheses are supported.

If an expression can’t be evaluated due to invalid syntax or referring to undefined field names, it will silently return zero.

Examples of valid expressions (note, no equal sign at the beginning):

  • fieldA * 2
  • fieldA * fieldB
  • abs(fieldA) * (2 + sqrt(fieldB))
  • amount * parent.price

Conditional operators

An expression can also contain a conditional expression that will return either 0 or 1. The supported operators are:

  • Equals (==) – Returns 1 when two values are equal, 0 otherwise
  • Not equals (!=) – Returns 1 when two values are not equal, 0 otherwise
  • Greater than (>) – Returns 1 when the first operand is greater than the second, 0 otherwise
  • Greater than or equal (>=) – Returns 1 when the first operand is greater than or equal to the second, 0 otherwise
  • Less than (<) – Returns 1 when the first operand is less than the second, 0 otherwise
  • Less than or equal (<=) – Returns 1 when the first operand is less than or equal to the second, 0 otherwise

Examples of valid expressions using conditional operators:

  • 10 == 10 (returns 1)
  • 10 == 2 (returns 0)
  • 10 > 2 (returns 1)
  • 10 < 2 (returns 0)
  • 10 <= 10 (returns 1)

Rounding functions

Round a decimal value to the nearest integer. Supported functions are:

  • round() – Uses standard mathematical rounding rules to round to nearest integer
  • ceil() – Rounds the value to the next higher integer
  • floor() – Rounds the value to the next lower integer

Examples of valid expressions using rounding functions:

  • round(10.2) (returns 10)
  • round(10.9) (returns 11)
  • round(10.888888 * 10) / 10 (returns 10.9)
  • ceil(10.2) (returns 11)
  • floor(10.2) (returns 10)

Note that the round() function only takes one parameter and always round to an integer. If you need to round to a higher precision, multiply and divide as shown in third example above.

Group fields (new from 1.2.4)

Fields defined as part of a group, subfields, can be addressed using the group name as a prefix. Inside the group, a field defined on the parent level can be addressed using the “parent” prefix. See examples below:

Valid formula to use the value of field “foobar” defined inside the group “group2”:
* group2.foobar + 10

Valid formula in a field inside a group (assuming the parent has a field named count):
* parent.count * 22

Array functions for repeater fields

If repeater fields are used, a calculated field in the parent field group can summarize a specific repeater sub fields using the aggregation functions sum, count, average, min or max. For example, the expression: “Sum(orderlines.amount)”” will return the sum of all the “amount” fields in the repeater field “orderlines”.

The available array functions are:

  • sum()
  • average()
  • count()
  • min()
  • max()

Note that anything after the dot (.) in the aggregate expression is an expression in itself. It’s perfectly OK to write a formula like: “Sum(orderlines.price * amount)”. This expression will walk over all lines in the “orderlines” repeater field, perform the calculation “price * amount” and return the sum of all lines.

Note that when working with aggregate functions, parentheses can not be used. If you need to aggregate a more complex calculation, you should add an extra field in the repeater group and let the aggregate function work on this extra field.

Data type and calculation order

Calculated fields works with the assumption that all fields are defined as numeric in the ACF editor. Using a text field in a formula WILL PRODUCE UNPREDICTABLE RESULTS.

Calculations are made as the custom field is stored to the database. To minimize the impact of performance, Calculated fields rely on field order. A formula field can only refer to fields ordered BEFORE itself. A formula field that refers to a field ordered after it WILL PRODUCE UNPREDICTABLE RESULTS.

DomainExposuresHeadersLast Checked
l*t*o*a.com F Jul 5, 2026
c*m*n*n*o*r*n*e*a*.org (WP 6.9.4) F Jul 1, 2026

Top 50 Plugins

Plugin Count
elementor 1,773,066
contact-form-7 1,754,699
elementor-pro 1,053,398
woocommerce 816,868
revslider 609,950
jetpack 456,151
js_composer 420,819
wp-rocket 341,566
essential-addons-for-elementor-lite 265,266
complianz-gdpr 257,980
gravityforms 257,686
google-site-kit 232,621
cookie-law-info 228,902
instagram-feed 225,266
sitepress-multilingual-cms 210,874
header-footer-elementor 207,407
google-analytics-for-wordpress 206,188
bluehost-wordpress-plugin 192,588
elementskit-lite 180,622
gutenberg 167,311
cookie-notice 149,235
litespeed-cache 143,547
gtranslate 125,193
wpforms-lite 124,272
the-events-calendar 122,579
astra-sites 113,631
gutenberg-core 113,508
popup-maker 110,000
woocommerce-payments 109,709
tablepress 102,202
honeypot 97,891
astra-addon 93,947
wp-smushit 91,090
duracelltomi-google-tag-manager 90,451
coblocks 89,789
layerslider 89,525
all-in-one-seo-pack 89,300
bb-plugin 87,066
akismet 85,166
premium-addons-for-elementor 84,433
ml-slider 83,034
cleantalk-spam-protect 82,813
mailchimp-for-wp 82,012
megamenu 80,374
woocommerce-gateway-stripe 79,700
jet-engine 77,827
fusion-builder 77,281
ewww-image-optimizer 76,638
wp-pagenavi 76,523
smart-slider-3 76,327

Top 50 Themes

Theme Count
hello-elementor 621,543
Divi 497,327
astra 415,116
flatsome 137,795
Avada 121,363
generatepress 114,678
oceanwp 80,569
pub 79,286
kadence 78,818
enfold 68,928
salient 65,362
twentyseventeen 54,403
bb-theme 53,484
betheme 52,451
twentytwentyfour 52,191
blocksy 51,007
cocoon-master 49,241
dt-the7 45,528
twentytwentyfive 44,925
woodmart 42,693
h4 39,561
neve 38,220
Avada-Child-Theme 36,954
gox 36,252
bridge 31,437
twentytwentyone 30,343
lightning 29,939
twentytwenty 28,835
swell 27,982
bricks 26,516
Impreza 26,104
Newspaper 24,234
twentytwentythree 22,139
epik-redesign 19,181
twentytwentytwo 18,831
uncode 18,592
twentysixteen 17,623
pro 17,621
sydney 16,585
storefront 16,374
Total 14,410
hello-theme-child-master 14,004
factory-templates-4 13,730
themify-ultra 12,971
extendable 12,866
hestia 12,599
yootheme 12,547
yith-wonder 12,223
porto 11,980
twentyfifteen 11,835