hash_nav_menu_args example



        /* * Replace object menu arg with a term_id menu arg, as this exports better * to JS and is easier to compare hashes. */
        if ( ! empty( $exported_args['menu'] ) && is_object( $exported_args['menu'] ) ) {
            $exported_args['menu'] = $exported_args['menu']->term_id;
        }

        ksort( $exported_args );
        $exported_args['args_hmac'] = $this->hash_nav_menu_args( $exported_args );

        $args['customize_preview_nav_menus_args']                            = $exported_args;
        $this->preview_nav_menu_instance_args[ $exported_args['args_hmac'] ] = $exported_args;
        return $args;
    }

    /** * Prepares wp_nav_menu() calls for partial refresh. * * Injects attributes into container element. * * @since 4.3.0 * * @see wp_nav_menu() * * @param string $nav_menu_content The HTML content for the navigation menu. * @param object $args An object containing wp_nav_menu() arguments. * @return string Nav menu HTML with selective refresh attributes added if partial can be refreshed. */
Home | Imprint | This part of the site doesn't use cookies.