wordpress

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2023 License: MIT Imports: 7 Imported by: 0

README

Basic Authentication

To authenticate is required this plugin: https://github.com/WP-API/Basic-Auth

More info: https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/

List of WP-API endpoints

https://developer.wordpress.org/rest-api/reference/

List of WP-API REST endpoints and implementation status

Attachments / Media

Comments

  • GET /comments
  • POST /comments (Implemented but untested)
  • GET /comments/[id]
  • PUT /comments/[id] (Implemented but untested)
  • DELETE /comments/[id] (Implemented but untested)

Meta

  • GET /[parent_base]/[parent_id]/meta
  • POST /[parent_base]/[parent_id]/meta
  • GET /[parent_base]/[parent_id]/meta/[id]
  • PUT /[parent_base]/[parent_id]/meta/[id]
  • DELETE /[parent_base]/[parent_id]/meta/[id]

[parent_base] = "posts" | "pages"

Meta Posts
  • GET /posts/[post_id]/meta
  • POST /posts/[post_id]/meta
  • GET /posts/[post_id]/meta/[id]
  • PUT /posts/[post_id]/meta/[id]
  • DELETE /posts/[post_id]/meta/[id]

https://developer.wordpress.org/rest-api/reference/posts/#list-posts

Meta Pages
  • GET /pages/[post_id]/meta
  • POST /pages/[post_id]/meta
  • GET /pages/[post_id]/meta/[id]
  • PUT /pages/[post_id]/meta/[id]
  • DELETE /pages/[post_id]/meta/[id]

Post Statuses

  • GET /statuses
  • GET /statuses/[slug]

Post Types

  • GET /types
  • GET /types/[slug]

Posts

  • GET /posts
  • POST /posts
  • GET /posts/[id]
  • PUT /posts/[id]
  • DELETE /posts/[id]

Pages

  • GET /pages
  • POST /pages
  • GET /pages/[id]
  • PUT /pages/[id]
  • DELETE /pages/[id]

Post Terms

  • GET /[post_base]/[post_id]/terms/[tax_base]
  • GET /[post_base]/[post_id]/terms/[tax_base]/[term_id]
  • POST /[post_base]/[post_id]/terms/[tax_base]/[term_id]
  • DELETE /[post_base]/[post_id]/terms/[tax_base]/[term_id]

[post_base] = "posts" [tax_base] = "tag" | "category"

Post Terms Tag
  • GET /posts/[post_id]/terms/tag
  • GET /posts/[post_id]/terms/tag/[term_id]
  • POST /posts/[post_id]/terms/tag/[term_id]
  • DELETE /posts/[post_id]/terms/tag/[term_id]
Post Terms Category
  • GET /posts/[post_id]/terms/category
  • GET /posts/[post_id]/terms/category/[term_id]
  • POST /posts/[post_id]/terms/category/[term_id]
  • DELETE /posts/[post_id]/terms/category/[term_id]

Revisions

  • GET /[parent_base]/[parent_id]/revisions
  • GET /[parent_base]/[parent_id]/revisions/[id]
  • DELETE /[parent_base]/[parent_id]/revisions/[id]

[parent_base] = "posts" | "pages"

Revisions Posts
  • GET /posts/[parent_id]/revisions
  • GET /posts/[parent_id]/revisions/[id]
  • DELETE /posts/[parent_id]/revisions/[id]
Revisions Pages
  • GET /pages/[parent_id]/revisions
  • GET /pages/[parent_id]/revisions/[id]
  • DELETE /pages/[parent_id]/revisions/[id]

Taxonomies

  • GET /taxonomies
  • GET /taxonomies/[slug]

Terms

  • GET /terms/[tax_base]
  • POST /terms/[tax_base]
  • GET /terms/[tax_base]/[id]
  • PUT /terms/[tax_base]/[id]
  • DELETE /terms/[tax_base]/[id]

[tax_base] = "tag" | "category"

Tag Terms
  • GET /terms/tag
  • POST /terms/tag
  • GET /terms/tag/[id]
  • PUT /terms/tag/[id]
  • DELETE /terms/tag/[id]
Category Terms
  • GET /terms/category
  • POST /terms/category
  • GET /terms/category/[id]
  • PUT /terms/category/[id]
  • DELETE /terms/category/[id]

Users

  • GET /users
  • POST /users
  • GET /users/[id]
  • PUT /users/[id]
  • DELETE /users/[id]
  • GET /users/me

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Wordpress

type Wordpress struct {
	// contains filtered or unexported fields
}

func NewWordpress

func NewWordpress(settings *commons.SettingsExternal) (instance *Wordpress, err error)

func (*Wordpress) Categories

func (instance *Wordpress) Categories() (ctrl *controller.CategoryCtrl)

func (*Wordpress) Get

func (instance *Wordpress) Get(url string) (response []byte, err error)

func (*Wordpress) GetUid

func (instance *Wordpress) GetUid() string

func (*Wordpress) IsEnabled

func (instance *Wordpress) IsEnabled() bool

func (*Wordpress) Media

func (instance *Wordpress) Media() (ctrl *controller.MediaCtrl)

func (*Wordpress) Post

func (instance *Wordpress) Post(url string, body interface{}) (response []byte, err error)

func (*Wordpress) Posts

func (instance *Wordpress) Posts() (ctrl *controller.PostCtrl)

func (*Wordpress) Publish

func (instance *Wordpress) Publish(item interface{}) (err error)

func (*Wordpress) PublishArticle

func (instance *Wordpress) PublishArticle(article *tmodels.CWArticle, status string) (err error)

func (*Wordpress) Tags

func (instance *Wordpress) Tags() (ctrl *controller.TagCtrl)

func (*Wordpress) Users

func (instance *Wordpress) Users() (ctrl *controller.UserCtrl)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL