library/Theme/Navigation.php
public function purgeTreeMenuTransientForAncestors($postId)
    {
        // Get page ancestors
        $ancestors = get_post_ancestors($postId);
        $ancestors[] = $postId;

        // Remove front page from ancestors array
        $ancestors = array_reverse($ancestors);

        if ($ancestors[0] == get_option('page_on_front')) {
            unset($ancestors[0]);
        }

        $ancestors = array_values($ancestors);

        // Delete transient for page ancestors
        foreach ($ancestors as $postId) {
            $children = get_children(array(
                'post_parent' => $postId,
                'numberofposts' => -1,
                'post_type' => 'page',
            ));

            foreach ($children as $child) {
                delete_transient('main_menu_' . $child->ID);
                delete_transient('mobile_menu_' . $child->ID);
                delete_transient('sidebar_menu_' . $child->ID);

                delete_transient('main_menu_' . $child->ID . '_loggedin');
                delete_transient('mobile_menu_' . $child->ID . '_loggedin');
                delete_transient('sidebar_menu_' . $child->ID . '_loggedin');
            }
        }
    }
public function purgeTreeMenuTransientForAncestors($postId)
    {
        // Get page ancestors
        $ancestors = get_post_ancestors($postId);
        $ancestors[] = $postId;

        // Remove front page from ancestors array
        $ancestors = array_reverse($ancestors);

        if ($ancestors[0] == get_option('page_on_front')) {
            unset($ancestors[0]);
        }

        $ancestors = array_values($ancestors);

        // Delete transient for page ancestors
        foreach ($ancestors as $postId) {
            $children = get_children(array(
                'post_parent' => $postId,
                'numberofposts' => -1,
                'post_type' => 'page',
            ));

            foreach ($children as $child) {
                delete_transient('main_menu_' . $child->ID);
                delete_transient('mobile_menu_' . $child->ID);
                delete_transient('sidebar_menu_' . $child->ID);

                delete_transient('main_menu_' . $child->ID . '_loggedin');
                delete_transient('mobile_menu_' . $child->ID . '_loggedin');
                delete_transient('sidebar_menu_' . $child->ID . '_loggedin');
            }
        }
    }
public function purgeTreeMenuTransientForAncestors ( $ postId ) { // Get page ancestors $ ancestors = get_post_ancestors ( $ postId ) ; $ ancestors [ ] = $ postId ; // Remove front page from ancestors array $ ancestors = array_reverse ( $ ancestors ) ; if ( $ ancestors [ 0 ] == get_option ( 'page_on_front' ) ) { unset ( $ ancestors [ 0 ] ) ; } $ ancestors = array_values ( $ ancestors ) ; // Delete transient for page ancestors foreach ( $ ancestors as $ postId ) { $ children = get_children ( array ( 'post_parent' => $ postId , 'numberofposts' => - 1 , 'post_type' => 'page' , ) ) ; foreach ( $ children as $ child ) { delete_transient ( 'main_menu_' . $ child -> ID ) ; delete_transient ( 'mobile_menu_' . $ child -> ID ) ; delete_transient ( 'sidebar_menu_' . $ child -> ID ) ; delete_transient ( 'main_menu_' . $ child -> ID . '_loggedin' ) ; delete_transient ( 'mobile_menu_' . $ child -> ID . '_loggedin' ) ; delete_transient ( 'sidebar_menu_' . $ child -> ID . '_loggedin' ) ; } } }
Delete tree menu transient for ancestors of post id.
@param int $postId The post id
@return void
Delete tree menu transient for ancestors of post id .