wp_check_post_hierarchy_for_loops
wp_check_post_hierarchy_for_loops ( $post_parent, $post_id )
Parameters:- (int) post_parent ID of the parent for the post we're checking.
- (int) post_id ID of the post we're checking.
See:Returns:- (int) The new post_parent for the post, 0 otherwise.
Defined at: - Introduced in WordPress: 3.1.0
- Deprecated in WordPress: —
Description
Checks the given subset of the post hierarchy for hierarchy loops.Prevents loops from forming and breaks those that it finds. Attached
to the {@see 'wp_insert_post_parent'} filter.