Updates Post Meta.

@param string $meta_key
@param string $values
@param string $prev_values

@return bool|int
506339
public function update_meta( $meta_key = '', $values = '', $prev_values = '' ) {
		return \update_post_meta( $this->id(), $meta_key, $values, $prev_values );
	}
144369
private static function updateFieldStrVal(&$field, $values, $key)
    {
        if (isset($values[$key]) && is_string($values[$key])) {
            $field->{$key} = $values[$key];
        }
    }
858613
public function save_meta( $_null, $post_ID = null, $meta_key = null, $meta_value = null ) {

		if ( 'code' === $meta_key ) {
			$post = get_post( $post_ID );

			if ( is_object( $post ) && $this->object_type == $post->post_type ) {
				$postdata = array(
					'ID'           => $post_ID,
					'post_content' => $meta_value,
				);

				remove_filter( current_filter(), array( $this, __FUNCTION__ ) );

				$revisions = false;

				if ( has_action( 'pre_post_update', 'wp_save_post_revision' ) ) {
					remove_action( 'pre_post_update', 'wp_save_post_revision' );

					$revisions = true;
				}

				wp_update_post( (object) $postdata );
				// objects will be automatically sanitized
				if ( $revisions ) {
					add_action( 'pre_post_update', 'wp_save_post_revision' );
				}

				return true;
			}//end if
		}//end if

		return $_null;
	}
848588
def pref_update(self, key, new_val):
        
        print('Update and save pref from: %s=%r, to: %s=%r' %
              (key, six.text_type(self[key]), key, six.text_type(new_val)))
        self.__setattr__(key, new_val)
        return self.save()
511552
public function meta($metaKey = '', $single = true)
	{
		$meta_values = get_post_meta($this->ID, $metaKey, $single);

		return $meta_values;
	}
200467
public function updateMetas( $model, $metas, $metaService ) {

		foreach( $metas as $meta ) {

			if( $meta->belongsTo( $model ) ) {

				$metaService->update( $meta );
			}
		}

		return true;
	}
16079
public function get_service_metas( $meta_name = false )
    {
        $meta_value = false;
        if( $meta_name &&  array_key_exists( $meta_name, $this->_service_metas ) )
        {
            $meta_value = $this->_service_metas[$meta_name];
        }

        return ( $meta_value ) ? $meta_value : $this->_service_metas;
    }
142784
public function dontSeePostMetaFor( $post, $meta_key, $meta_value = null ) {
		$metas = get_post_meta( $post, $meta_key );

		if ( func_num_args() > 2 ) {
			$message = sprintf( 'Post meta %s contains not expected value', $meta_key );
			$this->assertNotContains( $meta_value, $metas, $message );
		} else {
			$message = sprintf( 'Post meta %s is not empty', $meta_key );
			$this->assertEmpty( $metas, $message );
		}
	}
1001713
public function add_meta($key, $meta_data) {
	if (is_object($meta_data)) {
		$meta_data = parent::convert_object_to_array($meta_data);
	}
	
	$this->meta_data[$key] = $meta_data;
}
566292
function delete_meta($meta_key) {
		return $this->edit_meta( $meta_key, function($id, $key, $path) {
			if ( $path ) {
				# Patch -- XXX unserialize and count up?
				$old = static::_get_meta($id, $key);
				if ( $old === false ) $old = array();
				$traverser = new RecursiveDataStructureTraverser($old);
				while ( $path ) {
					# nothing to delete?
					if ( ! $traverser->exists($path[0]) ) return;
					$traverser = $traverser->traverse_to(array($path[0]));
					array_shift($path);
				}
				$traverser->unset_on_parent();
				static::_set_meta($id, $key, $old);  # XXX reserialize and count down?
			} else {
				static::_delete_meta($id, $key);
			}
		});
	}
172449
public void updatePostMetaValue(final long postId, final String metaKey, final String metaValue) throws SQLException {

      Meta currMeta = selectPostMetaValue(postId, metaKey);
      if(currMeta == null) {
         Connection conn = null;
         PreparedStatement stmt = null;
         Timer.Context ctx = metrics.setPostMetaTimer.time();
         try {
            conn = connectionSupplier.getConnection();
            stmt = conn.prepareStatement(insertPostMetaSQL);
            stmt.setLong(1, postId);
            stmt.setString(2, metaKey);
            stmt.setString(3, metaValue);
            stmt.executeUpdate();
         } finally {
            ctx.stop();
            SQLUtil.closeQuietly(conn, stmt);
         }
      } else {
         Connection conn = null;
         PreparedStatement stmt = null;
         Timer.Context ctx = metrics.setPostMetaTimer.time();
         try {
            conn = connectionSupplier.getConnection();
            stmt = conn.prepareStatement(updatePostMetaValueSQL);
            stmt.setString(1, metaValue);
            stmt.setString(2, metaKey);
            stmt.setLong(3, postId);
            stmt.executeUpdate();
         } finally {
            ctx.stop();
            SQLUtil.closeQuietly(conn, stmt);
         }
      }
   }
743860
public static function findByExactMeta ($meta_key, $meta_value, $post_type = PostTypes::ANY)
    {
        return get_posts(array(
            'post_type'  => $post_type,
            'meta_key'   => $meta_key,
            'meta_value' => $meta_value
        ));
    }
141374
public function setMeta($key, $value)
    {
        $meta = $this->meta;
        $meta[$key] = $value;
        $this->meta = $meta;

        return $this->save();
    }
915582
def _update_meta(self):
        
        for v in ["filename", "location", "prefix"]:
            if "meta" not in self:
                self["meta"] = {}
            self["meta"][v] = self[v]
            del self[v]
1027693
private void updateMeta(BundleMeta meta) {
    final int cols = meta.size();
    densecols = new NumberVector.Factory<?>[cols];
    for(int i = 0; i < cols; i++) {
      if(TypeUtil.SPARSE_VECTOR_VARIABLE_LENGTH.isAssignableFromType(meta.get(i))) {
        throw new AbortException("Filtering sparse vectors is not yet supported by this filter. Please contribute.");
      }
      if(TypeUtil.NUMBER_VECTOR_VARIABLE_LENGTH.isAssignableFromType(meta.get(i))) {
        VectorFieldTypeInformation<?> vmeta = (VectorFieldTypeInformation<?>) meta.get(i);
        densecols[i] = (NumberVector.Factory<?>) vmeta.getFactory();
        continue;
      }
    }
  }
855485
private void updateMeta(BundleMeta meta) {
    int cols = meta.size();
    densecols = BitsUtil.zero(cols);
    for(int i = 0; i < cols; i++) {
      if(TypeUtil.SPARSE_VECTOR_VARIABLE_LENGTH.isAssignableFromType(meta.get(i))) {
        throw new AbortException("Filtering sparse vectors is not yet supported by this filter. Please contribute.");
      }
      // TODO: only check for double and float?
      if(TypeUtil.NUMBER_VECTOR_VARIABLE_LENGTH.isAssignableFromType(meta.get(i))) {
        BitsUtil.setI(densecols, i);
        continue;
      }
      if(TypeUtil.DOUBLE_VECTOR_FIELD.isAssignableFromType(meta.get(i))) {
        BitsUtil.setI(densecols, i);
        continue;
      }
    }
  }
1278397
public function scopeWhereMetaIn(Builder $q, string $key, array $values)
    {
        $values = array_map(function ($val) use ($key) {
            return is_string($val) ? $val : $this->makeMeta($key, $val)->getRawValue();
        }, $values);

        $q->whereHas('meta', function (Builder $q) use ($key, $values) {
            $q->where('key', $key);
            $q->whereIn('value', $values);
        });
    }