Skip to content

Commit

Permalink
fixing undefined $data variable bug within uodate_menu_ids_cache() an…
Browse files Browse the repository at this point in the history
…d incrementing to version 1.3
  • Loading branch information
Kevin Langley Jr committed Jul 10, 2014
1 parent 55b0000 commit 9078735
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Voce Cached Nav
==================

Contributors: markparolisi, voceplatforms, nattyait
Contributors: markparolisi, voceplatforms, nattyait, kevinlangleyjr
Tags: nav, menus, cache, caching, performance
Requires at least: 3.3
Tested up to: 3.7.1
Stable tag: 1.2
Tested up to: 3.9.1
Stable tag: 1.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -35,6 +35,9 @@ Replacing your template calls to `wp_nav_menu` with `voce_cached_nav_menu`
* *Yes. The caching class is essentially just a refactor of that large core function with caching at all possible levels.*

# Changelog
**1.3**
* Fixing undefined $data variable bug when deleting menus

**1.2**
* Adding Capistrano deploy files

Expand Down
9 changes: 6 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
=== Voce Cached Nav ===
Contributors: markparolisi, voceplatforms, nattyait
Contributors: markparolisi, voceplatforms, nattyait, kevinlangleyjr
Tags: nav, menus, cache, caching, performance
Requires at least: 3.3
Tested up to: 3.7.1
Stable tag: 1.2
Tested up to: 3.9.1
Stable tag: 1.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -28,6 +28,9 @@ Yes. The caching class is essentially just a refactor of that large core functio
== Screenshots ==

== Changelog ==
= 1.3 =
* Fixing undefined $data variable bug when deleting menus

= 1.2 =
* Adding Capistrano deploy files

Expand Down
15 changes: 9 additions & 6 deletions voce-cached-nav.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Voce Cached Nav
Plugin URI: http://voceconnect.com
Description: Serve cached WordPress Navigation Objects.
Version: 1.2
Version: 1.3
Author: Mark Parolisi
License: GPL2
*/
Expand Down Expand Up @@ -111,11 +111,14 @@ public static function update_menu_ids_cache( $menu_id ) {
$data = $cache;
// If this is executing for the first time
} else {
if ( term_exists( (int) $menu_id, 'nav_menu' ) ) {
$data = array( $menu_id );
}
$data = ( term_exists( (int) $menu_id, 'nav_menu' ) ) ? array( $menu_id ) : false;
}

if( $data ){
set_transient( self::MENUIDS, $data );
} else {
delete_transient( self::MENUIDS );
}
set_transient( self::MENUIDS, $data );
}

/**
Expand Down Expand Up @@ -251,7 +254,7 @@ public static function menu( $args = array() ) {
if ( $menu_item->menu_item_parent )
$menu_items_with_children[ $menu_item->menu_item_parent ] = true;
}

// Add the menu-item-has-children class where applicable
if ( !empty( $menu_items_with_children ) ) {
foreach ( $sorted_menu_items as &$menu_item ) {
Expand Down

0 comments on commit 9078735

Please sign in to comment.