get_ancestors

過濾鉤子
apply_filters( 'get_ancestors', $ancestors, $object_id, $object_type, $resource_type )

get_ancestors: 這個函式以文章或術語ID的形式返回給定文章、頁面或類別的祖先(父輩、祖輩等)的陣列: 該函式將文章ID作為第一個引數,將文章型別(預設為”文章”)作為第二個引數。該陣列以頂級祖先為第一項,直接父類為最後一項的方式排序。

這個過濾器在wp-includes/taxonomy.php中有記錄。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
return apply_filters( 'get_ancestors', $ancestors, $object_id, $object_type, $resource_type );
return apply_filters( 'get_ancestors', $ancestors, $object_id, $object_type, $resource_type );
return apply_filters( 'get_ancestors', $ancestors, $object_id, $object_type, $resource_type );

常見問題

FAQs
檢視更多 >