@param string $key
@param int|null $user_id
@param mixed $meta_value

@return bool
772989
public function delete( $key, $user_id = null, $meta_value = '' ) {
		if ( ! isset( $user_id ) ) {
			$user_id = $this->user_id;
		}
		if ( $user_id <= 0 ) {
			return false;
		}

		return delete_user_meta( $user_id, $this->get_meta_key( $key ), $meta_value );
	}
34570
public function unset($post_id, string $key)
    {
        $post_id = (int) ($post_id ?? get_the_ID());

        if (!$post_id || !$key) {
            return; // Not possible.
        }
        delete_post_meta($post_id, $this->key($key));
    }
106503
public static function meta($key = null, $value = null) {
		$self = static::_object();
		$isArray = is_array($key);

		if ($value || $isArray) {
			$value ? $self->_meta[$key] = $value : $self->_meta = $key + $self->_meta;
			return;
		}
		return $self->_getMetaKey($isArray ? null : $key);
	}
1079622
public function seePostMetaFor( $post_id, $meta_key, $meta_value = null ) {
		$metas = get_post_meta( $post_id, $meta_key );

		$message = sprintf( 'Post meta %s does not exist', $meta_key );
		$this->assertNotEmpty( $metas, $message );

		if ( func_num_args() > 2 ) {
			$message = sprintf( 'Post meta %s does not contain expected value', $meta_key );
			$this->assertContains( $meta_value, $metas, $message );
		}
	}
1016930
public function update($user_id, array $data)
    {
        $result = null;
        $this->hook->attach('user.update.before', $user_id, $data, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        $data['modified'] = GC_TIME;

        if (!empty($data['password'])) {
            $data['hash'] = gplcart_string_hash($data['password']);
        }

        if ($this->isSuperadmin($user_id)) {
            $data['status'] = 1;
        }

        $updated = $this->db->update('user', $data, array('user_id' => $user_id));
        $data['user_id'] = $user_id;
        $updated += (int) $this->setAddress($data);

        $result = $updated > 0;
        $this->hook->attach('user.update.after', $user_id, $data, $result, $this);
        return (bool) $result;
    }
1269602
public final function getMetadata($key = null)
   {
       return isset($key)
            ? (array_key_exists($key, $this->meta) ? $this->meta[$key] : null)
            : $this->meta;
   }
694140
public function update_metadata($meta_key, $meta_value)
    {
        $this->meta[$meta_key] = $meta_value;

        update_user_meta($this->ID, $meta_key, $meta_value);
    }
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
        ));
    }
404152
public function userGet(int $user_id)
    {
        $value = get_user_meta($user_id, $this->getName(), true);

        if (! empty($value)) {
            $this->setValue($value);
        }
    }
1175012
public static function success($key, $user_id, $key_id = null)
    {
        return static::notify($key, $user_id, $key_id, self::TYPE_SUCCESS);
    }
145905
public function meta($key = null, $value = null)
    {
        if (is_null($key)) {
            return $this->getMeta();
        }

        if (is_null($value)) {
            return $this->getMeta($key);
        }

        return $this->setMeta($key, $value);
    }
349652
function getMeta($metaKey = null)
    {
        if ($metaKey !== null)
            return (isset($this->meta[$metaKey])) ? $this->meta[$metaKey] : null;

        return $this->meta;
    }
675004
protected function setUser($user_id)
    {
        $this->data_user = array();

        if (is_numeric($user_id)) {

            $this->data_user = $this->user->get($user_id);

            if (empty($this->data_user)) {
                $this->outputHttpStatus(404);
            }
        }
    }
577812
public function getUserData($key, $id = 0)
    {
        // Current User id
        if (!$id) {
            if (defined('USER_ID')) {
                $id = USER_ID;
            } else {
                return NULL;
            }
        } else {
            $id = abs((int)$id);
        }

        // Check or init cache
        if (!isset(self::$cached_user_data[$id])) {
            $user = AdminUserRepository::findOneEntityById($id);
            if (!$user) {
                return NULL;
            }
            self::$cached_user_data[$id] = $user->getAsArray();

            // Unset critical data
            unset(self::$cached_user_data[$id]['password']);
        }

        return isset(self::$cached_user_data[$id][$key]) ? self::$cached_user_data[$id][$key] : NULL;
    }
466597
public function updateMeta($key, $value)
    {
        if ($meta = $this->getMeta($key)) {
            $meta->value = $value;

            return $meta->save();
        }

        return false;
    }
578058
public function isIgnoring($user_id)
    {
        if ((new Query)->select('id')->from('{{%podium_user_ignore}}')->where([
                'user_id' => $this->id,
                'ignored_id' => $user_id
            ])->exists()) {
            return true;
        }
        return false;
    }
623991
public static function destroyByUser($user_id)
	{
		$user_id = (is_array($user_id) ? $user_id : array($user_id));

		$blank = self::blank();

		$query = $blank->getQuery()
			->delete($blank->getTableName())
			->whereIn('user_id', $user_id);

		if (!$query->execute())
		{
			return false;
		}

		return true;
	}