ms_model_membership_get_membership_ids

We only cache the IDs to avoid re-querying the database.

Description

apply_filters( 'ms_model_membership_get_membership_ids', (unknown) $membership_ids_key, (unknown) $args ); 

The positive side effect is, that the memory used by the membership list will be freed again after the calling function is done with it.

If we cache the whole list here, it would not occupy memory for the whole request duration which can cause memory_limit errors.

Parameters (2)

0. $membership_ids_key (unknown)
The membership ids key.
1. $args (unknown)
The args.

Usage

To run the hook, copy the example below.
  1. $membership_ids_key = apply_filters( 'ms_model_membership_get_membership_ids', $membership_ids_key, $args ); 
  2.  
  3. if ( !empty( $membership_ids_key ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the ms_model_membership_get_membership_ids callback 
  2. function filter_ms_model_membership_get_membership_ids( $membership_ids_key, $args ) { 
  3. // make filter magic happen here... 
  4. return $membership_ids_key
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'ms_model_membership_get_membership_ids', 'filter_ms_model_membership_get_membership_ids', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'ms_model_membership_get_membership_ids', 'filter_ms_model_membership_get_membership_ids', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/app/model/class-ms-model-membership.php  
  1. return apply_filters(