Give 1.8.14 – Introducing the new Give_Donors_Query class

In Give version 1.8.14, We are introducing the new Give_Donors_Query class which will help developers to query donors more easily and efficiently with less code. [Read]

Here is a general code sample query parameters for Give_Donors_Query:

$donor = new Give_Donors_Query(array(
    'number'     => 20,
    'offset'     => 0,
    'paged'      => 1,
    'orderby'    => 'id',
    'order'      => 'DESC',
    'user'       => null,   // Single or array of user ids
    'email'      => null,   // Single or comma seperated emails
    'donor'      => null,   // Single or array of donor ids
    'meta_query' => array(),
    'date_query' => array(),
    's'          => null,   // search string with prefix name: or note:
    'fields'     => 'all', // Support donors (all fields) or valid column  as string or array
    'count'      => false, // Set to true to get donor count for current query

Another demo query for the Give_Donors_Query class:

1. Get donors and sort by total donation amount:

$donors = new Give_Donors_Query(array(
    'number'     => -1,
    'orderby'    => 'purchase_value',
$donors = $donors->get_donors();

2. Get donors and sort by total donation count:

$donors = new Give_Donors_Query(array(
    'number'     => -1,
    'orderby'    => 'purchase_count',
$donors = $donors->get_donors();

3. Get information about specific donors:

$donors = new Give_Donors_Query(array(
    'donor'    => array( 11, 45, 67 ),
$donors = $donors->get_donors();

4. Get the total number of donors:

$donors = new Give_Donors_Query(array(
    'number' => -1,
    'count' => true,
$donors = $donors->get_donors();

This class was created because we found it difficult and cumbersome to do more complex donor queries. We will continue to optimize the class as we move forward. Please let us know if you find any issues on GitHub.


Give 1.8.14 – Give_Notices Class Update

In Give version 1.8.9 we introduced the Notices API. In release 1.8.14 we are adding improvements to the API so that you can create non-dismissible notice without a close icon appearing [Read]. This type of notice should only be used for very important messages, like blockers, such as database updates and missing dependancies.

Here is a general code example to create a notice with the Give_Notices API:

    'id' => '' // Value: unique notice id
    'type' => '' // Value: error/warning/success/info/updated
    'description' => '' // Value: notice message content
    'dismissible' => '' // Value: auto/true/false. if set to true then notice will auto class in 5 seconds
    'dismissible_type' => '' // Value: null/user/all
    'dismiss_interval' => '' // Value shortly/permanent/custom
    'dismiss_interval_time' => '' // Value: time interval in seconds (only need if dismiss_interval set to custom)


If you want to create non-dismissible notice without close icon set dismissible to false.

Non dismissible notices without close icon

In addition to the new non-dismissible notice enhancement we have deprecated the auto-dismissible parameter for simply dismissible with backward compatibility.

We’re also working to create inline notices and other additional notice enhancements in the future so stay tuned!


Give 1.8.13 Tab Improvements & Conditional Field Changes

Give 1.8.13 introduces subtle improvements to the tabbed interface when editing a donation form. The improvements are summarized below along with a new requirement that developers should be aware in order to produce a seamless tabbed experience.

Added Unique Tab URLs

Each tab now has a unique URL denoted by a give-tab query parameter that updates on each tab change. This means that tabs can be navigated to directly, bookmarked, and most importantly, maintained after a page reload. For example, the URL of the Form Display tab would be structured as follows:

Added Active Tab Persistence

Because each tab now has a unique URL, the active tab can be maintained after save. For example, if the active tab is Form Display when the form is published or updated, then the page will reload with Form Display as the active tab. The result is a more seamless experience, especially for users who save and refresh the screen often during the initial form build.

Tab detection is made possible by a $_GET['give-tab'] parameter that is detected server-side and included in the redirect after save.

Removed Conditional Fields Flicker

In previous versions of Give, conditional fields that should be hidden by default would flicker upon page load. This flicker occurred because conditional fields were being hidden via JavaScript after page load. As of Give 1.8.13, a give-hidden class is applied to conditional fields via PHP so that they are hidden by default, thus preventing any chance of flicker.

Developers Note This Important Change to Conditional Fields

When registering conditional settings in the future, developers should ensure that the 'wrapper_class' => 'give-hidden' is used in order to hide the conditional field by default. An example use case is provided below.

 * Below are two field settings. If Custom Amount is enabled, then Minimum
 * Amount becomes visible. Note the use of 'wrapper_class' in the
 * conditional field to ensure Minimum Amount is hidden by default.

// Regular field.
    'name'        => __( 'Custom Amount', 'give' ),
    'description' => __( '...', 'give' ),
    'id'          => $prefix . 'custom_amount',
    'type'        => 'radio_inline',
    'default'     => 'disabled',
    'options'     => array(
        'enabled'  => __( 'Enabled', 'give' ),
        'disabled' => __( 'Disabled', 'give' ),

// Conditional field.
    'name'          => __( 'Minimum Amount', 'give' ),
    'description'   => __( '...', 'give' ),
    'id'            => $prefix . 'custom_amount_minimum',
    'type'          => 'text_small',
    'data_type'     => 'price',
    'attributes'    => array(
        'placeholder' => $price_placeholder,
        'value'       => $custom_amount_minimum,
        'class'       => 'give-money-field',
    'wrapper_class' => 'give-hidden', // Note the use of 'wrapper_class'.

We’re Now Using ESLint for WordPress Coding Standards in GiveWP

WordPress has already defined Javascript Coding Standards which needs to be followed during development of WordPress Core, Plugins, or Themes. This allows developers to maintain the quality of the platform and even you can save time by getting rid of common JS errors.

Following WordPress Javascript Coding Standards using ESLint

To overcome JS errors and maintain quality for JS files as per the coding standards defined by WordPress, we have introduced ESLint in the upcoming release 1.8.12.

ESLint is a pluggable linting utility for Javascript which helps developers to get rid of common errors during development.

How to Configure ESLint

We’ve packaged Give Core with the ESLint config file. So, you need to worry much about it and just follow simple steps once and you’re done!

Step 1: Install Node Modules as defined in Give’s package.json

$ npm install

Step 2: Using ESLint

With Terminal:

  1. Open Terminal
  2. Type Command in format: eslint [options] file.js [file.js] [dir]
  3. You’ll get list of suggestions, if any:
Example of ESLint Suggestions

An example of ESLint suggestions

For Example,
$ eslint yourfile.js

With PHPStorm… please read on:

Configuring PHPStorm with ESLint

We use PHPStorm as our IDE of choice. If you use it as well, follow the below steps to configure ESLint with PHPStorm:

  1. Open PHPStorm and go to Preferences > Languages and Frameworks > Javascript > Code Quality Tools > ESLint
  2. Now, Tick the Enable checkbox.
  3. Set path for Node Interpreter and the ESLint Package, if it is not set by default.
Steps to configure ESLint in PHPStorm

Steps to configure ESLint in PHPStorm

ESLint suggestions in PHPStorm

ESLint suggestions in PHPStorm

That’s it! Now you’re all set up to code JavaScript in GiveWP using WordPress Coding Standards. Happy Coding! 🙂


Give 2.0 – Introducing an Improved Email System

In Give version 2.0+, we are making many enhancements to the core email settings. First off, all of the core emails now can be editing on a global or per form basis. As well, you can now preview and send test emails for all email types. We’ve put a lot of work into this new email API to make it flexible for both developers and WordPress backend managers.

Our hope is that this update frees you from having to spend time writing any complex code for your custom emails. As well, with the power to customize and preview emails

Let’s Explore Further:

Better email interface and easier testing. Previously you could only preview specific emails. In 2.0+ we developed the new Send Email and Preview Email features to reduce the amount of time it takes to check and test your emails.

Better email testing tools

Email testing tools

Quick change email notification status:

You can easily click on email notification status icon to the change notification status.

Quick Edit email notification status

Easy edit email notification status

Better email listings:

Now you can see all core or custom email at one place with brief information about them.

Email List

Email List

Per Email Settings

Now you will have more control on global and per form email settings.

Global email setting:

Global email setting

Global email setting

Per form email setting:

Per form email setting

Per form email setting

How to Create Custom Emails

To create a custom email notification you can easily extend the Give_Email_Notification class. You can then easily set the configuration for your email notification. You can find list of config options here:

You can also check out this snippet which we created for custom email notification:

You can find core default notification here:


Support for Per User Language Settings Coming in Version 1.8.9

WordPress has supported per user language settings since version 4.7. This allows users to set their preferred language under their profile settings. If you are running a multilingual website, this is a vital feature for those users who don’t speak the site wide language setting.

Up until now, Give has only supported the site wide language setting. This means that if you changed your profile’s language setting to another language, all core WP menu items would update but Give would still be using the site’s language setting. With the upcoming release of Give 1.8.9 this is no more. Now your users can enjoy Give in the language they prefer, providing that there is a translation available for that specific language.

How it Works

If you are using WordPress 4.7+ (and you should be) then your site users can now change the language to their preference in wp-admin:

Per User Language Setting

Per User Language Setting

When I change the setting to Deutsch, you’ll see Give’s menu update as well:

Prior to 1.8.9 this menu item would have been in English, the site setting.

As well, the donations forms will also respect the user setting:

Frontend Give for In German, the User's Language Setting

Frontend Give for In German, the User’s Language Setting

More i18n Extras

  • WPML has been fully audited for support with the help of their developer Vuk Vukovic. Thanks for that! You can also see our page here on their site:
  • Simplified load_textdomain() method within the main give.php file – the use of unload_textdomain() allows for the per user language setting to work.

Don’t See Your Language? Help Us Translate Give

We’re always looking for help supporting more languages with the plugin. If you are multilingual, please consider helping translate our plugin!

Help Translate Give »


Give 2.0 – Welcome Hint.css and Goodbye qTip2

In Give version 2.0+ we are deprecating  qTip2 (with backward compatibility, of course) and all tooltips (frontend + backend) will be generated with the new Give_Tooltips class. We’ve put a lot of work into this new class so it can handle all the various types of tooltips supported by hint.css, a pure CSS solution. Now you can create flexible tooltips based on your specific needs with a simple setup and the flexibility you expect from a professionally developed WordPress plugin.

Our hope is that this update frees you from having to spend time writing any complex code for your custom Give tooltips. As well, it will give your users a better experience and also add a little speed boost to your sites since no additional JS is needed. Finally, since this is a pure CSS solution, this update also reduces the chances of potential conflicts with other scripts. Let’s explore further:

The Types of Tooltips

You can create multiple types of tooltips by specifying different properties:

  1. Position:
    1. Top
    2. Top Right
    3. Top Left
    4. Right
    5. Left
    6. Bottom
    7. Bottom Right
    8. Bottom Left
  2. Status:
    1. Error
    2. Warning
    3. Info
    4. Success
  3. Size:
    1. Small
    2. Medium
    3. Large
  4. Display:
    1. Show always
    2. Show on mouse hover
  5. Style:
    1. Square edges
    2. Round Edges
  6. Animation:
    1. No animation
    2. Bounce animation

How to Create Tooltips in Give 2.0+

Here is a general code sample to create a tooltip with Give_Tooltip with Give 2.0+:

    // Tooltip tag.
    'tag'         => '',
    'tag_content' => '',

    // Set to link of anchor if tooltip tag is anchor.
    'link'        => '#',

    // Text for tooltip
    'label'       => '',

    // Value: top-right, top, top-left, right, left, bottom-right, bottom, bottom-left.
    'position'    => 'top',

    // Value: error, warning, info, success.
    'status'      => '',

    // Value: small, medium, large.
    'size'        => '',

    // Value: true/false.
    'show_always' => false,

    // Value: true/false
    'round_edges' => false,

    // Value: true/false
    'animate'     => true,

    // Attributes.
    'attributes'  => array(),

    // Value: true/false
    // If set to true then automatically core will set size for tooltip on basic of word count of label. 
    'auto_width'  => true,

There are also some helper functions to quickly create tooltips:

/* The function below also accepts an array */
// Output span with question icon.
Give()->tooltips->render_help(/* Tooltip Text */);

/* The function below also accepts an array */
// Output span.
Give()->tooltips->render_span(/* Tooltip Text */);

// Output link.
Give()->tooltips->render_link(array( /*tooltip setting values*/ ));

This update is just one of many optimizations we’ll be releasing in the next major version of Give. Stay tuned for more!