WordPress filter hook

ct_query_fields_request

Fired by 5 WordPress plugins, running on 16K+ sites between them.

“Filters the SELECT clause of the query.”

How to use ct_query_fields_request

It's a filter: your callback receives the value, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'ct_query_fields_request', function( $fields, $arg2 ) {
	// Change $fields here.
	return $fields;
}, 10, 2 );

Argument names come from GamiPress's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

5 plugins that fire ct_query_fields_request

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. GamiPress icon GamiPress10,000+ installs apply_filters_ref_array( 'ct_query_fields_request', array( $fields, &$this ) ) libraries/ct/includes/class-ct-query.php:564
  2. AutomatorWP icon AutomatorWP6,000+ installs apply_filters_ref_array( 'ct_query_fields_request', array( $fields, &$this ) ) libraries/ct/includes/class-ct-query.php:564
  3. ShortLinks Pro icon ShortLinks Pro100+ installs apply_filters_ref_array( 'ct_query_fields_request', array( $fields, &$this ) ) libraries/ct/includes/class-ct-query.php:564
  4. BBForms icon BBForms20+ installs apply_filters_ref_array( 'ct_query_fields_request', array( $fields, &$this ) ) libraries/ct/includes/class-ct-query.php:564
  5. WhatAvatar icon WhatAvatar20+ installs apply_filters_ref_array( 'ct_query_fields_request', array( $fields, &$this ) ) libraries/ct/includes/class-ct-query.php:564

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.