Skip to content

Correct handling of format argument #12

Description

@craigedmunds

It looks like there's a mistake in the format logic, resulting in the format always being set to json.

This code appears in utils.js, perhaps it should be if(!flags.format)?

if(flags.format)
    flags.format="json";

The nett result is that when running an option update call:

wp.option.update(["show_on_front","page"], { }, function(err,result) {

I get "Error: Invalid JSON: page" - providing a different format (e.g. format: "count" ) doesn't work because the code above overrides it to json.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions