Support » Plugin: GravityWP - Count » Filter on entry_meta

  • Resolved memralife

    (@memralife)


    Hi guys,

    Having found a way round the encryption issues by setting entry_meta field, I am now revisiting GravityWP Count.

    Is there any way of filtering using operators other than “is”, “isnot” and “contains”? I would love to be able to use greater than/less than or in/notin an array. I am guessing that former would work if the field was GF Numeric but as it is an entry_meta field that it is a normal string.

    Any help would be wonderful but I know better than to hold my breath on a long shot like this 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author GravityWP

    (@gravitywp)

    Hi @memralife,

    currently the plugin supports isnot, not_equal, greater_than, less_than, contains, starts_with, ends_with (it uses the standard gravity forms conditional logic rules). I’m not sure what you mean with setting the entry_meta field, but if you found a solution that can help others, feel free to share!

    Kind regards,
    GravityWP

    Thread Starter memralife

    (@memralife)

    Thanks for the guide – I was struggling to work out the extact term for greater_than 🙂

    As for getting round the encrypted data issue, this is what I did – it is a little complex and your milage may vary.

    Pick a field that you do not mind being available unecrypted and that you want to count (or search/filter on).
    Referencing here create an entry_meta filter for the form. Remember check the form_id at the start of the filter procedure or it will fire for every form.
    Create an array for the field eg:-

    $entry_meta['SearchGroup'] = array(
    		'label' => 'Search - Group',
    		'is_numeric' => false,
    		'update_entry_meta_callback' => 'update_meta_cr_group',
    		'is_default_column' => true,
    		'filter' => array('operators' => array('is','isnot'))
    );

    Create the function for the callback eg:-

    function update_meta_cr_group($key,$lead,$form) {
    	return $lead[26];
    }

    Sit back and find you have an unencrypted field that can be searched, filtered and counted.
    Note that this only effects entries that are created or edited after the filter is added.

    Plugin Author GravityWP

    (@gravitywp)

    Thank you @memralife!

    That is very helpful. We will share it with the users in the readme.txt in the next release. If you have any more suggestions or improvements to the code, please help us, very much appreciated!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Filter on entry_meta’ is closed to new replies.