Download the PHP
package gebruederheitz/wp-simple-rest without Composer
On this page you can find all versions of the php package
gebruederheitz/wp-simple-rest. It is possible to download/install
these versions without Composer. Possible dependencies are resolved
automatically.
Vendor gebruederheitz Package wp-simple-rest Short Description A trait to help you set up REST endpoints in Wordpress. License
GPL-3.0-only
FAQ
After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.
Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.
In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories.
In this case some credentials are needed to access such packages.
Please use the auth.json textarea to insert credentials, if a package is coming from a private repository.
You can look here for more information.
Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
To use Composer is sometimes complicated. Especially for beginners.
Composer needs much resources. Sometimes they are not available on a simple webspace.
If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
A trait to help you set up REST endpoints in Wordpress.
Helps you with registering and processing REST endpoints in Wordpress projects.
Installation
Usage
Getting the defined routes' full URLs
Changing the route base path
Upgrading
Installation
via composer:
Make sure you have Composer autoload or an alternative class loader present.
Usage
You could now execute your callback with the following request:
Alternatively you can use the static variant allowing you to call only static
methods on your class:
Setting the route's access
You should always explicitly define your route's access privileges, otherwise
Wordpress will wiggle its finger in your face. You can choose one of the
convenience methods provided by RestRoute or supply your own callback:
Getting the defined routes' full URLs
Changing the route base path
Your routes will now be available at /wp-json/my-rest-routes/v1/rest-example.
Upgrading
To version 2.x
From v1.x to v2.0 the namespaces used in the library changed. You will need to
update your use statements to reflect those changes:
Composer command for our command line client (download client)This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free.Standard composer command
The package gebruederheitz/wp-simple-rest contains the following files
Loading the files please wait ...
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.