Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes Call-time pass-by-reference errors

  • Loading branch information...
commit a4dad48dabfe00111e0a7d8f3335369ef8831d2f 1 parent 9a97837
@loxK loxK authored
View
2  models/NavMenuHacks.php
@@ -49,7 +49,7 @@ function wp_get_nav_menu_items ($items, $menu, $args) {
$pages = get_pages ( apply_filters ( 'gecka-submenu-get_pages', array ('child_of' => $item->object_id, 'sort_column' => 'menu_order, post_title', 'post_type'=> isset($item->object) ? $item->object : 'page' ) ) );
- $this->setup_posts ( 'post', &$item, &$pages, &$items, &$order );
+ $this->setup_posts ( 'post', $item, $pages, $items, $order );
break;
}
View
22 models/Submenu.php
@@ -153,7 +153,7 @@ private function Build($Options = null)
// current page is top level element
if( $submenu === 'current' ) {
global $wp_query;
- $submenu = $this->get_associated_nav_menu_item($wp_query->get_queried_object_id(), &$menu_items, $_type);
+ $submenu = $this->get_associated_nav_menu_item($wp_query->get_queried_object_id(), $menu_items, $_type);
}
// top parent page is the top level element
@@ -162,7 +162,7 @@ private function Build($Options = null)
global $post, $wp_query;
if( ( is_a($post, 'stdClass') || is_a($post, 'WP_Post') ) && (int)$post->ID ) {
- if( $submenu = $this->get_top_ancestor ($wp_query->get_queried_object_id(), &$menu_items, $_type) )
+ if( $submenu = $this->get_top_ancestor ($wp_query->get_queried_object_id(), $menu_items, $_type) )
$submenu = $submenu->ID;
}
@@ -177,13 +177,13 @@ private function Build($Options = null)
if( !is_object($submenu) ) {
- $submenu_item = $this->get_menu_item ($submenu, &$menu_items);
+ $submenu_item = $this->get_menu_item ($submenu, $menu_items);
- if( !$submenu_item ) $submenu_item = $this->get_associated_nav_menu_item($submenu, &$menu_items, $type);
+ if( !$submenu_item ) $submenu_item = $this->get_associated_nav_menu_item($submenu, $menu_items, $type);
if(!$submenu_item) return;
}
- if( !$this->menu_item_has_child($submenu_item->ID, &$menu_items)) return;
+ if( !$this->menu_item_has_child($submenu_item->ID, $menu_items)) return;
$submenu_id = $submenu_item->ID;
@@ -227,16 +227,16 @@ private function Build($Options = null)
* @param int $postID post ID to look for
* @return object $Item a menu item object or false
*/
- private function get_top_ancestor ($postID, &$menu_items, $type='post_type') {
+ private function get_top_ancestor ($postID, $menu_items, $type='post_type') {
- $Item = $this->get_associated_nav_menu_item($postID, &$menu_items, $type);
+ $Item = $this->get_associated_nav_menu_item($postID, $menu_items, $type);
if(!$Item) return;
$Ancestror = $Item;
while(1) {
if($Item->menu_item_parent) {
- $Item = $this->get_menu_item($Item->menu_item_parent, &$menu_items);
+ $Item = $this->get_menu_item($Item->menu_item_parent, $menu_items);
continue;
}
break;
@@ -271,7 +271,7 @@ public function get_associated_nav_menu_item($object_id, &$menu_items, $type='po
$offset = abs( (int)$offset );
- $AssociatedMenuItems = $this->get_associated_nav_menu_items( $object_id, &$menu_items, $type );
+ $AssociatedMenuItems = $this->get_associated_nav_menu_items( $object_id, $menu_items, $type );
if( !$num = sizeof($AssociatedMenuItems) ) return false;
@@ -295,7 +295,7 @@ function get_associated_nav_menu_items( $object_id, &$menu_items, $object_type =
if( !empty($_menu_items) || $object_type !== 'post_type' ) return $_menu_items;
// no associated 'post_type' menu item found, looking for associated 'taxonomy' menu item
- return $this->get_associated_nav_menu_terms_items ( $object_id, &$menu_items );;
+ return $this->get_associated_nav_menu_terms_items ( $object_id, $menu_items );;
}
function get_associated_nav_menu_terms_items ( $object_id, &$menu_items ) {
@@ -313,7 +313,7 @@ function get_associated_nav_menu_terms_items ( $object_id, &$menu_items ) {
foreach ($terms as $term) {
- $_menu_items = $this->get_associated_nav_menu_items($term->term_id, &$menu_items, 'taxonomy');
+ $_menu_items = $this->get_associated_nav_menu_items($term->term_id, $menu_items, 'taxonomy');
if( !empty($_menu_items) ) return $_menu_items;
}
View
2  widgets/Custom-menu.php
@@ -184,7 +184,7 @@ public function menu_items_options ($id, $default='') {
$options = '<option value="0">' . __('Nav menu root', Gecka_Submenu::Domain) .'</option>';
$options .= '<option value="current"'.selected('current', $default).'>' . __('Current page', Gecka_Submenu::Domain) .'</option>';
$options .= '<option value="top"'.selected('top', $default).'>' . __('Current page\'s top parent', Gecka_Submenu::Domain) .'</option>';
- $options .= call_user_func_array( array(&$walker, 'walk'), $args );
+ $options .= call_user_func_array( array($walker, 'walk'), $args );
return $options;
Please sign in to comment.
Something went wrong with that request. Please try again.