=== Plugin Name === Contributors: gravitywp Donate link: http://gravitywp.com/support/ Tags: gravity forms, number field, count, form, forms, gravity form Requires at least: 3.0.1 Tested up to: 4.4.1 Stable tag: 4.4.1 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Count, filter and display total number of Gravity Forms entries or the total of a number field for multiple entries. == Description == Most simple version of the shortcode (display number of total entries Gravity Forms for a form): **[gravitywp_count formid=""]** Or when you count a number field (display total count of a number field for all entries a specific Gravity Form): **[gravitywp_count formid="" number_field=""]** The most extensive version of the shortcode (display the total count of a number field from multiple Gravity Forms entries with up to five filters and input for number of decimals, the decimal point notation and the thousand seperator): **[gravitywp_count formid="" formstatus="" number_field="" filter_mode="" filter_field="" filter_operator="" filter_value="" filter_operator2="" filter_field2="" filter_value2="" filter_field3="" filter_operator3="" filter_value3="" filter_field4="" filter_operator4="" filter_value4="" filter_field4="" filter_operator4="" filter_value4="" decimals="" dec_point="" thousands_sep=""]** ### Use the shortcode generator [Generate your shortcode on GravityWP.com](http://gravitywp.com/plugins/count/shortcode-generator/) ### Shortcodes to use for counting entries Here you find the shortcodes to count the total of entries (with or without filters). You will notice that you don't have to fill in decimals or decimal points, because these shortcodes only count the total of entries (which is always a whole number). It is possible to define a thousand seperator. = gravitywp_count = [gravitywp_count formid="2" thousands_sep=","] or use the default (thousand seperator is a comma): [gravitywp_count formid="2"] **formid**: This is the id of the form you want to target your shortcode at. It’s in orange **thousands_sep**: The thousands seperator is to, what it says, the notation you use to seperate thousands. In the USA this is a comma, in Europa this is a point. For example a million in USA is: 1,000,000.00 and in Europe it is: 1.000.000,00. You can define the thousands seperator in the shortcode. = With 1 filter = [gravitywp_count formid="2" filter_field="3" filter_value="IT developer" thousands_sep="," ] **filter_field**: this is the Field ID you want to use in your filter. Go to your Gravity Form, go to the Field (text, dropdown, radio button) you want to use as your filter and write down the Field ID number to use in filter_field in your shortcode. **filter_value**: write here the exact value that is in your text, radio button or dropdown. If you clicked ‘show values’, use the text under Value. = With 2 filters = [gravitywp_count formid="2" filter_field="3" filter_value="IT developer" filter_field2="5" filter_value2="41 and older" thousands_sep="," ] **filter_field2**: this is the Field ID you want to use in your second filter. **filter_value2**: write here the exact value that is in your text, radio button or dropdown (for the second filter!). If you clicked ‘show values’, use the text under Value. ### Shortcodes to use for counting totals of a number field Here you find the shortcodes you can use to calculate the totals of number fields in multiple Gravity Forms entries. = Count and display a number field calculation (without filters)= If you want to count the total of a number field from multiple entries, use this shortcode: [gravitywp_count formid="2" number_field="4" decimals="2" dec_point="." thousands_sep="," ] or use the default shortcode (2 decimals, dec_point ="." and thousands_sep=","): [gravitywp_count formid="2" number_field="4"] **number_field**: This is the ID of the number field you want to target. Make sure this is a number field! **decimals**: This is how many decimals you want to show (after the point (if you are in the US or England) or after the comma (if you are in Europe or the rest of the world)). You can type 0 (zero) if you only want to show whole numbers. You can type 1, 2, 3, 4 or 10 or more to show more decimal numbers. **dec_point**: This is what decimal point you want to use. In the USA and England this is a point. In Europe, the comma is used to show the decimal point. For example: USA: 1.23 and Europe: 1,23. = One filter field = If you want to use the Count Plugin and filter on 1 field (text, dropdown, radio button), use this shortcode: [gravitywp_count formid="2" number_field="4" filter_field="3" filter_value="IT developer" decimals="2" dec_point="." thousands_sep="," ] = Two filter fields = If you want to use the Count Plugin and filter on 2 fields (text, dropdown, radio button), use this shortcode: [gravitywp_count formid="2" number_field="4" filter_field="3" filter_value="IT developer" filter_field2="5" filter_value2="41 and older" decimals="2" dec_point="." thousands_sep="," ] == Installation == Upload the plugin files to the `/wp-content/plugins/gravitywp-count` directory, or install the plugin through the WordPress plugins screen directly. == Changelog == = 0.7 = * Added attribute add_number="" to the shortcode. With this attribute you can add or subtract a number from the output. For example add_number="100" will add 100 to the output. For example add_number="-100" wil subtract 100 from the output. = 0.6 = * Added filter_operator (conditional logic) attributes for filtering to shortcode (default: is | other options: isnot, not_equal, greater_than, less_than, contains, starts_with, ends_with) * Added formstatus attribute to shortcode (default: active | other options: spam, trash, all ) * Added filter mode options to attribute of the shortcode filter_mode (default: all | other options: any) * Improved structure of the code for easier adding of extra possibilities * Added 3 more filter options: filter_field3, filter_field4, filter_field5 (+ operators and values e.g. filter_operator3, filter_value5 etc) = 0.5 = * Cleaned up the code (removed the old shortcodes, so please update your shortcodes! No backward compability) * Exclude entries that are in trash * Set default formid to zero = 0.4 = * Make only 1 shortcode that automatically manages the input * Updated readme.txt = 0.3.1 = * Set default values for decimal, dec_point and thousands_sep * Cleaned up some code * Updated the readme.txt = 0.3 = * Added shortcode for counting total number of entries * Added shortcode for counting total number of entries with 1 filter * Added shortcode for counting total number of entries with 2 filters * Added shortcode for counting total number of entries which are starred * Updated the readme.txt = 0.2 = * Added decimal and thousand seperator * Added multiple shortcodes (for different filtering options) * Updated the readme.txt = 0.1 = * Added only the function to count the total of a number field for multiple entries in Gravity Forms