WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 4965 | */ |
| 4966 | function get_ancestors( $object_id = 0, $object_type = '', $resource_type = '' ) { |
| 4967 | $object_id = (int) $object_id; |
| 4968 | |
| 4969 | $ancestors = array(); |
| 4970 | |
| 4971 | if ( empty( $object_id ) ) { |
| 4972 | |
| 4973 | /** This filter is documented in wp-includes/taxonomy.php */ |
| 4974 | return apply_filters( 'get_ancestors', $ancestors, $object_id, $object_type, $resource_type ); |
| 4975 | } |
| 4976 | |
| 4977 | if ( ! $resource_type ) { |
| 4978 | if ( is_taxonomy_hierarchical( $object_type ) ) { |
| 4979 | $resource_type = 'taxonomy'; |
| 4980 | } elseif ( post_type_exists( $object_type ) ) { |
| 4981 | $resource_type = 'post_type'; |
| 4982 | } |
| 4983 | } |
| Line | Code |
| 4997 | * |
| 4998 | * @since 3.1.0 |
| 4999 | * @since 4.1.1 Introduced the `$resource_type` parameter. |
| 5000 | * |
| 5001 | * @param int[] $ancestors An array of IDs of object ancestors. |
| 5002 | * @param int $object_id Object ID. |
| 5003 | * @param string $object_type Type of object. |
| 5004 | * @param string $resource_type Type of resource $object_type is. |
| 5005 | */ |
| 5006 | return apply_filters( 'get_ancestors', $ancestors, $object_id, $object_type, $resource_type ); |
| 5007 | } |
| 5008 | |
| 5009 | /** |
| 5010 | * Returns the term's parent's term ID. |
| 5011 | * |
| 5012 | * @since 3.1.0 |
| 5013 | * |
| 5014 | * @param int $term_id Term ID. |
| 5015 | * @param string $taxonomy Taxonomy name. |