PHPackages                             media-store-net/wp-rest-registration - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. media-store-net/wp-rest-registration

ActiveLibrary[API Development](/categories/api)

media-store-net/wp-rest-registration
====================================

A Simple Way to Register Rest Routes to WP

1.0.9(3y ago)1188MITPHPPHP &gt;=7.3 || &gt;=8.0

Since Nov 26Pushed 3y agoCompare

[ Source](https://github.com/media-store-net/WpRestRegistration)[ Packagist](https://packagist.org/packages/media-store-net/wp-rest-registration)[ Docs](https://github.com/media-store-net/WpRestRegistration)[ RSS](/packages/media-store-net-wp-rest-registration/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (4)Versions (6)Used By (0)

WpRestRegistration
==================

[](#wprestregistration)

A Simple Way to Register Rest Routes to WordPress

Installation
------------

[](#installation)

The easiest way to install is using Composer in your Project

`composer require media-store-net/wp-rest-registration:dev-master`

Download the Repo on Github

or clone it
`git clone https://github.com/media-store-net/WpRestRegistration.git`

How to use?
-----------

[](#how-to-use)

First you need define a Callback function in your functions.php or other File that is included in your Wordpres Installation or anyone of your Plugin Files.

#### Define Callback Function

[](#define-callback-function)

- For GET Request
    `function myFunction(WP_REST_Request $request) {  // return anything as REST Logic }`
- for POST Request
    `function myPostFunction(WP_REST_Request $request) { // Do anything with $request // return response }`

#### Use WpRestRegistration Class

[](#use-wprestregistration-class)

now you can register a Route calling the WpRestRegistartion Class

*on Top of your php-file*

`use MediaStoreNet\WpRestRegistration\WpRestRegistration as Rest`

*register a Route*

`new Rest( $Namespace, $RestName, $Callback, $Method = GET, $permission_callback='__return_true' $actionHook = 'rest_api_init' )`

---

*- basic usage for GET Request*

`new Rest( 'myApp/v1', 'myRestName', 'myFunction' );`

By default you can omit the optional parameters for a GET Endpoint To call the RestRoute use  in your Browser or using Postman

---

*- basic usage for POST Request*

`new Rest( 'myApp/v1', 'myRestName', 'myPostFunction', 'POST' );`

Now you can call the same URL, using POST-Method and include $data to your Request

*- edit permissions*

By default is the $permissions\_callback='\_\_return\_true' open for all requests.

But you can change this bahaviouer for your endpoints

`new Rest( 'myApp/v1', 'myRestName', 'myFunction', 'GET', current_user_can('manage_options') )`

#### \*\* Have Fun \*\*

[](#-have-fun-)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity70

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~355 days

Total

5

Last Release

1303d ago

PHP version history (2 changes)1.0.3PHP ^5.6.37 || ^7.0

1.0.9PHP &gt;=7.3 || &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3de5bd4b6e0c6349b9fd6b393336cf7b7065167dc87b5597821a09dedf9b9399?d=identicon)[media-store-net](/maintainers/media-store-net)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/media-store-net-wp-rest-registration/health.svg)

```
[![Health](https://phpackages.com/badges/media-store-net-wp-rest-registration/health.svg)](https://phpackages.com/packages/media-store-net-wp-rest-registration)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
