diff --git a/zoninator.php b/zoninator.php index 368d705..7fea30a 100644 --- a/zoninator.php +++ b/zoninator.php @@ -916,7 +916,6 @@ function insert_zone( $slug, $name = '', $details = array() ) { $name = ! empty( $name ) ? $name : $slug; $details = wp_parse_args( $details, $this->zone_detail_defaults ); - $details = maybe_serialize( stripslashes_deep( $details ) ); $args = array( 'slug' => $slug, @@ -926,6 +925,9 @@ function insert_zone( $slug, $name = '', $details = array() ) { // Filterize to allow other inputs $args = apply_filters( 'zoninator_insert_zone', $args ); + // Serialize the description. + $args['description'] = maybe_serialize( stripslashes_deep( $args['description'] ) ); + return wp_insert_term( $name, $this->zone_taxonomy, $args ); } @@ -940,9 +942,7 @@ function update_zone( $zone, $data = array() ) { $details = $this->_get_value_or_default( 'details', $data, array() ); // TODO: Back-fill current zone details - //$details = wp_parse_args( $details, $this->zone_detail_defaults ); $details = wp_parse_args( $details, $this->zone_detail_defaults ); - $details = maybe_serialize( stripslashes_deep( $details ) ); $args = array( 'name' => $name, @@ -953,6 +953,9 @@ function update_zone( $zone, $data = array() ) { // Filterize to allow other inputs $args = apply_filters( 'zoninator_update_zone', $args, $zone_id, $zone ); + // Serialize the description. + $args['description'] = maybe_serialize( stripslashes_deep( $args['description'] ) ); + return wp_update_term( $zone_id, $this->zone_taxonomy, $args ); } return new WP_Error( 'invalid-zone', __( 'Sorry, that zone doesn\'t exist.', 'zoninator' ) );