Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Merge pull request #127 from szk11001/master
Browse files Browse the repository at this point in the history
404 for Private Page & Disabling left nav for mega menu
  • Loading branch information
amb00010 committed Oct 21, 2015
2 parents dff9584 + debfcd4 commit 1060c7a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
9 changes: 8 additions & 1 deletion 404.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
* @package cornerstone
*/
get_header(); ?>
<?php
$private = get_post_meta(get_queried_object()->ID, 'uc-private', true);
if($private == 'admins' || $private == 'users' || $private == 'list' || $private == 'netids'){
$private = true;
echo 'This is a private page';
}
?>
<div id="error404">
<div class="row">
<div class="col-sm-12">
Expand All @@ -24,7 +31,7 @@
</div>
<div class="col-sm-6">
<ul>
<?php
<?php
if (wp_get_nav_menu_object('404')){
$defaults = array(
'menu' => '404',
Expand Down
7 changes: 4 additions & 3 deletions inc/submenu-check.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,21 @@
foreach($menu_items as $key => $menu_item) {
while(in_array($menu_item->menu_item_parent, $stack) && $menu_item->menu_item_parent != array_pop($stack)) {
$level--;
}
}
$level++;
$stack[] = $menu_item->menu_item_parent;
$stack[] = $menu_item->ID;
$menu_items[$key]->level = $level;

if($menu_item->menu_item_parent == $current_id && $level > 2 || $menu_item->ID == $current_id && $level > 2 && $navoption1 == 'drop'){
$has_sub_menu = true;
}
}
}
//print_r($menu_items);
}
if($has_sub_menu){
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
if(!is_plugin_active( 'megamenu/megamenu.php' ) && $has_sub_menu){
?>
<div class="row">
<div class="col-sm-3">
Expand Down

0 comments on commit 1060c7a

Please sign in to comment.