get_ancestors

This filter is documented in wp-includes/taxonomy.php.

Description

apply_filters( 'get_ancestors', (unknown) $ancestors, (unknown) $object_id, (unknown) $object_type, (unknown) $resource_type ); 

Parameters (4)

0. $ancestors (unknown)
The ancestors.
1. $object_id (unknown)
The object id.
2. $object_type (unknown)
The object type.
3. $resource_type (unknown)
The resource type.

Usage

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

Defined (2)

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

/wp-includes/taxonomy.php  
  1. return apply_filters( 'get_ancestors', $ancestors, $object_id, $object_type, $resource_type ); 
  1. return apply_filters( 'get_ancestors', $ancestors, $object_id, $object_type, $resource_type );