예제 #1
0
 function gk_nav_menu($location)
 {
     $menus = gk_config('nav');
     $args = $menus[$location];
     $args['theme_location'] = $location;
     wp_nav_menu($args);
 }
예제 #2
0
        update_option('gkwp_check_upgrade',$gkwp_check_upgrade);
    }
}

if(isset($gkwp_check_upgrade['latest_version']) && $gkwp_version!=$gkwp_check_upgrade['latest_version']){
    $GLOBALS['gk_upgrade_msg'] = $gkwp_check_upgrade['latest_msg'];
    add_action('admin_notices','gk_upgrade_notices');
}

function gk_upgrade_notices(){
    echo '<div class="update-nag">'.$GLOBALS['gk_upgrade_msg'].'</div>';
}

}*/
//调试模式
if (gk_config('debug') && current_user_can('level_10')) {
    //结果错误
    set_error_handler('gk_error_handler');
    add_action('gk_show_debug', 'gk_show_debug');
    add_filter('template_include', 'gk_get_template');
}
function gk_error_handler($errno, $errstr, $errfile, $errline)
{
    $GLOBALS['gk_error'][] = array($errno, $errstr, $errfile, $errline);
}
function gk_get_template($template)
{
    $GLOBALS['gk_template'] = $template;
    return $template;
}
function gk_show_debug()