public function update_value( $values, $slug, $post_id ) {
		if ( is_object( $values ) ) {
			$values = (array) $values;
		}

		if ( ! isset( $values['url'] ) ) {
			$values = $this->link_fields;

			foreach ( $values as $index => $key ) {
				$values[sprintf( '%s_%s', $slug, $key )] = '';
				unset( $values[$index] );
			}

			// Delete the required field.
			$values[$slug] = '';

			return $values;
		}

		// If a url exists we can continue making the meta fields
		// that should be saved.
		$values = $this->prepare_link_array( $values, $slug );

		foreach ( $values as $key => $val ) {
			$values[sprintf( '%s_%s', $slug, $key )] = $val;
			unset( $values[$key] );
		}

		// Required field so Papi can load a value from the
		// original property slug.
		$values[$slug] = 1;

		return $values;
	}
public function update_value( $values, $slug, $post_id ) {
		if ( is_object( $values ) ) {
			$values = (array) $values;
		}

		if ( ! isset( $values['url'] ) ) {
			$values = $this->link_fields;

			foreach ( $values as $index => $key ) {
				$values[sprintf( '%s_%s', $slug, $key )] = '';
				unset( $values[$index] );
			}

			// Delete the required field.
			$values[$slug] = '';

			return $values;
		}

		// If a url exists we can continue making the meta fields
		// that should be saved.
		$values = $this->prepare_link_array( $values, $slug );

		foreach ( $values as $key => $val ) {
			$values[sprintf( '%s_%s', $slug, $key )] = $val;
			unset( $values[$key] );
		}

		// Required field so Papi can load a value from the
		// original property slug.
		$values[$slug] = 1;

		return $values;
	}
public function update_value ( $ values , $ slug , $ post_id ) { if ( is_object ( $ values ) ) { $ values = ( array ) $ values ; } if ( ! isset ( $ values [ 'url' ] ) ) { $ values = $ this -> link_fields ; foreach ( $ values as $ index => $ key ) { $ values [ sprintf ( '%s_%s' , $ slug , $ key ) ] = '' ; unset ( $ values [ $ index ] ) ; } // Delete the required field. $ values [ $ slug ] = '' ; return $ values ; } // If a url exists we can continue making the meta fields // that should be saved. $ values = $ this -> prepare_link_array ( $ values , $ slug ) ; foreach ( $ values as $ key => $ val ) { $ values [ sprintf ( '%s_%s' , $ slug , $ key ) ] = $ val ; unset ( $ values [ $ key ] ) ; } // Required field so Papi can load a value from the // original property slug. $ values [ $ slug ] = 1 ; return $ values ; }
Prepare value for the database.

@param  mixed  $values
@param  string $slug
@param  int    $post_id

@return array
Prepare value for the database .