Drafts Script Reference
    Preparing search index...

    Class WordPress

    Constructors

    • Create new instance

      Parameters

      • siteURL: string

        This should be the full URL to the home page of the WordPress site. e.g. https://mysite.com or https://mysite.com/blog/.

      • blogId: string

        For most WordPress installations, use 1.

      • Optionalusername: string

        Username to login to the WordPress site. Optional if only using runMethod, as credentials will be required directly in parameters for those calls.

      • Optionalpassword: string

        Password to login to the WordPress site. Optional if only using runMethod, as credentials will be required directly in parameters for those calls.

      Returns WordPress

    Methods

    • Returns object[] | undefined

    • Parameters

      • postId: string

      Returns object | undefined

    • Parameters

      • Optionalfilter: any

      Returns object[] | undefined

    • Returns object[] | undefined

    • Returns object[] | undefined

    • Returns object[] | undefined

    • Parameters

      • Optionaltaxonomy: string

      Returns object | undefined

    • Parameters

      • Optionaltaxonomy: string
      • Optionalfilter: any

      Returns object[] | undefined

    • Parameters

      • content: string

      Returns string | undefined

    • Run an XML-RPC API method on a WordPress site. Any method name supported by the WordPress XML-RPC API can be used, as long as the authentication information provided has appropriate permissions on the site.

      Parameters

      • methodName: string

        The method name as documented in the WordPress XML-RPC API, for example wp.newPost to create a new post.

      • parameters: any[]

        Parameters should be a Javascript array of parameters for the method being used. These vary depending on the method and should follow the documentation provided by WordPress.

      Returns XMLRPCResponse

    • Create new instance

      Parameters

      • siteURL: string

        This should be the full URL to the home page of the WordPress site. e.g. https://mysite.com or https://mysite.com/blog/.

      • blogId: string

        For most WordPress installations, use 1.

      • Optionalusername: string

        Username to login to the WordPress site. Optional if only using runMethod, as credentials will be required directly in parameters for those calls.

      • Optionalpassword: string

        Password to login to the WordPress site. Optional if only using runMethod, as credentials will be required directly in parameters for those calls.

      Returns WordPress