Overview
  • Namespace
  • Class

Namespaces

  • MatthiasWeb
    • RealMediaLibrary
      • api
      • attachment
      • base
      • comp
        • complexquery
      • folder
      • general
      • metadata
      • order
      • rest
      • usersettings
  • None

Classes

  • Attachment
  • Folder
  • Reset
  • Service

Class Service

Create a REST Service.

MatthiasWeb\RealMediaLibrary\base\Base
Extended by MatthiasWeb\RealMediaLibrary\rest\Service
Namespace: MatthiasWeb\RealMediaLibrary\rest
Located at rest/Service.class.php

Methods summary

public
# rest_api_init( )

Register endpoints.

Register endpoints.

public
# routeHierarchy( $request )

Api

{put} /realmedialibrary/v1/hierarchy/:id Change a folder position within the hierarchy

Apigroup

Tree

Apiname

PutHierarchy

Apiparam

{int} id The folder id
{int} parent The parent
{int} nextId The next id to the folder

Apiversion

1.0.0
public
# routeTree( $request )

Api

{get} /realmedialibrary/v1/tree Get the full categories tree

Apigroup

Tree

Apiname

GetTree

Apiparam

{string} [currentUrl] The current url to detect the active item

Apiversion

1.0.0
public
# routeTreeDropdown( $request )

Api

{get} /realmedialibrary/v1/tree/dropdown Get the full categories tree as dropdown options (HTML)

Apigroup

Tree

Apiname

GetTreeDropdown

Apiparam

{string} [selected] The selected folder id

Apiversion

1.0.0
public
# getUserSettingsHTML( $request )

Api

{get} /realmedialibrary/v1/usersettings Get the HTML for user settings

Apigroup

Folder

Apiname

GetUserSettingsHTML

Apiversion

1.0.0
public
# updateUserSettings( $request )

Api

{put} /realmedialibrary/v1/usersettings Update user settings

Apidescription

Send a key value map of form data so UserSettings implementations (IUsetSettings) can handle it

Apigroup

UserSettings

Apiname

UpdateUserSettings

Apiversion

1.0.0
public
# routePlugin( )

Api

{get} /realmedialibrary/v1/plugin Get plugin information

Apigroup

Plugin

Apiheader

{string} X-WP-Nonce

Apiname

GetPlugin

Apisuccessexample

{json} Success-Response: { WC requires at least: "", WC tested up to: "", Name: "WP ReactJS Starter", PluginURI: "https://matthias-web.com/wordpress", Version: "0.1.0", Description: "This WordPress plugin demonstrates how to setup a plugin that uses React and ES6 in a WordPress plugin. By Matthias Guenter.", Author: "Matthias Guenter", AuthorURI: "https://matthias-web.com", TextDomain: "wp-reactjs-starter", DomainPath: "/languages", Network: false, Title: "WP ReactJS Starter", AuthorName: "Matthias Guenter" }


Apiversion

0.1.0
public static
# getUrl( string $namespace, string $endpoint = '' )

Get the wp-json URL for a defined REST service.

Get the wp-json URL for a defined REST service.

Parameters

$namespace
The prefix for REST service
$endpoint
The path appended to the prefix

Example

Service::url(Service::SERVICE_NAMESPACE) // => main path

Returns

String Example: https://example.com/wp-json

Methods inherited from MatthiasWeb\RealMediaLibrary\base\Base

debug(), getCore(), getTableName()

Constants summary

string SERVICE_NAMESPACE

The namespace for this service.

The namespace for this service.

See

Service::getUrl()
# 'realmedialibrary/v1'
API documentation generated by ApiGen