wpcom.ex v0.2.0 Wpcom View Source

wpcom.ex is the official Elixir library for the WordPress.com REST API

Link to this section Summary

Functions

Builds api base URL.

Builds a full API url using the supplied path and optional api version.

Fetches api version config value if it exists and valid; default if not.

Switches wpcom.ex to the supplied api version.

Link to this section Functions

Link to this function

api_base(version)

View Source
api_base(:restV1 | :restV11 | :wpV2 | :wpcomV2) :: String.t()

Builds api base URL.

Link to this function

api_url(endpoint, api_version \\ nil)

View Source
api_url(String.t(), :restV1 | :restV11 | :wpV2 | :wpcomV2 | nil) :: String.t()

Builds a full API url using the supplied path and optional api version.

Link to this function

get_api_version()

View Source
get_api_version() :: :restV1 | :restV11 | :wpV2 | :wpcomV2

Fetches api version config value if it exists and valid; default if not.

Link to this function

switch_api_version(new_version)

View Source
switch_api_version(:restV1 | :restV11 | :wpV2 | :wpcomV2) :: :ok

Switches wpcom.ex to the supplied api version.