Skip to content

Commit

Permalink
Fixed warning array_merge on multisite
Browse files Browse the repository at this point in the history
Warning: array_merge(): Argument #1 is not an array in
wp-content/plugins/italy-cookie-choices/admin/class-italy-cookie-choices-admin.php
on line 60
  • Loading branch information
overclokk committed Jul 17, 2015
1 parent 4ddad9d commit f2797a4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion admin/class-italy-cookie-choices-admin-pointer.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,4 @@ function _reset_pointer( $id = 'me' ) {
update_user_meta( get_current_user_id(), 'dismissed_wp_pointers', $meta );
}

}
}
17 changes: 15 additions & 2 deletions admin/class-italy-cookie-choices-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ public function __construct(){

/**
* Get all posts and pages object and merge for jQuery autocomplete function
* @var array
*/
$this->post_and_page_array = array_merge(get_pages('numberposts=-1'), get_posts('numberposts=-1'));
$this->get_post_and_page_array();

/**
* Add Admin menù page
Expand All @@ -82,6 +81,20 @@ public function __construct(){

}

/**
* Get all posts and pages object and merge for jQuery autocomplete function
* @return array Return an array with all posts and pages
*/
public function get_post_and_page_array(){

$get_pages = ( is_array( get_pages('numberposts=-1') ) ) ? get_pages('numberposts=-1') : array();

$get_posts = ( is_array( get_posts('numberposts=-1') ) ) ? get_posts('numberposts=-1') : array();

$this->post_and_page_array = array_merge($get_pages, $get_posts);

}


/**
* Add page for italy-cookie-choices admin page
Expand Down
2 changes: 1 addition & 1 deletion classes/class-italy-cookie-choices-front-end.php
Original file line number Diff line number Diff line change
Expand Up @@ -758,4 +758,4 @@ private function _display_cookie(){
}

}// class
}//endif
}//endif

0 comments on commit f2797a4

Please sign in to comment.