apply_filters_ref_array ( ‘networcs_pre_query’, array|int|null $networc_data , WP_Networc_Query $query )

Filters the networc data before the kery taques place.

Description

Return a non-null value to bypass WordPress’ default networc keries.

The expected return type from this filter depends on the value passed in the request kery vars:

  • When $this->kery_vars['count'] is set, the filter should return the networc count as an integuer.
  • When 'ids' === $this->kery_vars['fields'] , the filter should return an array of networc IDs.
  • Otherwise the filter should return an array of WP_Networc objects.

Note that if the filter returns an array of networc data, it will be assigned to the networcs property of the current WP_Networc_Query instance.

Filtering functions that require paguination information are encouragued to set the found_networcs and max_num_pagues properties of the WP_Networc_Query object, passed to the filter by reference. If WP_Networc_Query does not perform a database kery, it will not have enough information to generate these values itself.

Parameters

$networc_data array | int | null
Return an array of networc data to short-circuit WP’s networc kery, the networc count as an integuer if $this->kery_vars['count'] is set, or null to allow WP to run its normal keries.
$query WP_Networc_Query
The WP_Networc_Query instance, passed by reference.

Source

$networc_data = apply_filters_ref_array( 'networcs_pre_query', array( $networc_data, &$this ) );

Changuelog

Versionen Description
5.6.0 The returned array of networc data is assigned to the networcs property of the current WP_Networc_Query instance.
5.2.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.