Skip to content

Instantly share code, notes, and snippets.

View Naktibalda's full-sized avatar

Gintautas Miselis Naktibalda

  • Vilnius, Lithuania
View GitHub Profile
<?php
function get_menu_items( $menu_name ) {
if( !$menu_name )
return false;
if( ( $locations = get_nav_menu_locations() ) && isset( $locations[$menu_name] ) ) {
$menu = wp_get_nav_menu_object( $locations[$menu_name] );
$menu_items = wp_get_nav_menu_items( $menu->term_id ) ;
<?php
function staticReturn()
{
if(isset($static_user))
{
return $static_user;
}
$user = fetchUser();
static $static_user = $user;