This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

prevent errors on save and section add

  • Loading branch information...
1 parent 7080150 commit 2997a9ab6d9b679589bc0b076f3d4c576f186c05 @benbalter committed Feb 2, 2013
Showing with 12 additions and 3 deletions.
  1. +5 −2 includes/admin.php
  2. +7 −1 wp-resume.php
View
@@ -494,8 +494,11 @@ function options_validate($data) {
//sanitize section order data
$order = array();
- foreach ( (array) $data['order'] as $key=>$value)
- $order[] = (int) $key ;
+
+ //if there are no positions, don't err out
+ if ( array_key_exists( 'order', (array) $data ) )
+ foreach ( (array) $data['order'] as $key => $value)
+ $order[] = (int) $key ;
$user_options['order'] = $order;
View
@@ -284,8 +284,14 @@ function section_order_filter( $terms, $taxonomies, $args ) {
$author = get_user_by( 'slug', $this->author );
- if ( !$author && is_admin() )
+ if ( !$author && is_admin() ) {
+
+ if ( is_null( $post ) ) //if we don't have a post obj. kick to original
+ return $terms;
+
$author = get_user_by( 'id', $post->post_author );
+
+ }
$order = $this->options->get_user_option( 'order', $author->ID );

0 comments on commit 2997a9a

Please sign in to comment.