getPostMeta
Last updated
Last updated
Function getPostMeta
allows you to get the saved post meta value by passing postID
and metaID
parameters. Uses as a promises polyfill.
For server-side use .
Enqueue a script and . This will give you the global alchemyOptions
variable.
getPostMeta
returns the kew defer, so you can deal with the promise later.
If for some reason getPostMeta
fails, you can deal with it in the fail
method. It can happen if the AJAX request errored or was aborted.
Most of the time getPostMeta
will be successful, even if you pass non-existent IDs to it. Consider the following example:
If you pass the ID of a post that doesn't exist, the call will still be successful, the data
property will be an empty string.
The same thing will happen if you ask for non-existent metaID
.
Name
Type
Description
postID
number
Post ID to query for the meta (required)
metaID
string
Post meta ID (required)
More info can be found in the .