PHPackages                             kucrut/bridge - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. kucrut/bridge

ActiveWordpress-plugin[HTTP &amp; Networking](/categories/http)

kucrut/bridge
=============

Additional REST API endpoints and functionalities

v0.9.0(5y ago)7268GPL-2.0PHP

Since May 28Pushed 5y ago1 watchersCompare

[ Source](https://github.com/kucrut/wp-bridge)[ Packagist](https://packagist.org/packages/kucrut/bridge)[ Docs](https://github.com/kucrut/wp-bridge)[ RSS](/packages/kucrut-bridge/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (1)Dependencies (2)Versions (10)Used By (0)

Bridge
======

[](#bridge)

This plugin was built to provide a bridge between WordPress and [Minnie](https://github.com/kucrut/minnie). It modifies the results of some WP API requests.

Requirements
------------

[](#requirements)

- WordPress 4.5
- WP API 2.0-beta13

More bridges:
-------------

[](#more-bridges)

- [Menus](https://github.com/kucrut/wp-bridge-menus)
- [Post Formats](https://github.com/kucrut/wp-bridge-post-formats)

Endpoints
---------

[](#endpoints)

### Info

[](#info)

Endpoint: `/wp-json/bridge/v1/info`

```
{
  "url": "https://kucrut.org/wp",
  "home": "https://kucrut.org",
  "name": "Dzikri Aziz",
  "description": "WordPress Developer, Traveler.",
  "lang": "en-US",
  "html_dir": "ltr",
  "settings": {
    "archive": {
      "per_page": 11
    },
    "comments": {
      "per_page": 50,
      "threads": true,
      "threads_depth": 3
    }
  }
}
```

Results Modifications
---------------------

[](#results-modifications)

To get a modified result, a "Client ID" must be registered first:

```
/**
 * Register to the Bridge plugin
 *
 * @param   array  $client_ids Client IDs.
 * @wp_hook filter bridge_client_ids
 * @return  array
 */
function minnie_register_to_bridge( $client_ids ) {
	$client_ids[] = 'minnie';

	return $client_ids;
}
add_filter( 'bridge_client_ids', 'minnie_register_to_bridge' );
```

Then, every API request must include an `X-Requested-With` header and the value set to the registered Client ID, in this case `minnie`.

### Terms

[](#terms)

Home URL is stripped from term links.

#### Original Result

[](#original-result)

```
[
  {
    "id": 3,
    "count": 0,
    "description": "",
    "link": "http://example.org/blog/type/aside/",
    "name": "Aside",
    "slug": "post-format-aside",
    "taxonomy": "post_format"
  }
]
```

#### Modified Result

[](#modified-result)

```
[
  {
    "id": 3,
    "count": 0,
    "description": "",
    "link": "/blog/type/aside/",
    "name": "Aside",
    "slug": "post-format-aside",
    "taxonomy": "post_format"
  }
]
```

### Posts

[](#posts)

The result of requests to posts endpoints will have these modifications:

- Home URL is stripped from `link`, `content.rendered`.
- `title` gets a new item: `from_content`. It's generated from post content and is useful in case the post doesn't have a title and you still want to display a generated title on the client app.
- `date_formatted` and `modified_formatted` are added, so you don't need to format the post dates in the client app.
- The value of `categories`, `tags` and `formats` is converted to WP\_Term objects.
- When post preview is requested (by setting the `preview` parameter to `1`), the title and content will be replaced with the ones from the post's latest revision.

#### Original Result

[](#original-result-1)

```
{
  "id": 1,
  "date": "2016-02-20T02:09:47",
  "date_gmt": "2016-02-20T02:09:47",
  "guid": {
    "rendered": "http://src.wordpress-develop.dev/?p=1"
  },
  "modified": "2016-05-24T11:34:19",
  "modified_gmt": "2016-05-24T11:34:19",
  "slug": "hello-world",
  "type": "post",
  "link": "http://src.wordpress-develop.dev/blog/2016/02/20/hello-world/",
  "title": {
    "rendered": "Hello world!"
  },
  "content": {
    "rendered": "Welcome to WordPress. This is your first post. Edit or delete it, then start writing!\n"
  },
  "excerpt": {
    "rendered": "Welcome to WordPress. This is your first post. Edit or delete it, then start writing!\n"
  },
  "author": 1,
  "featured_media": 0,
  "comment_status": "open",
  "ping_status": "open",
  "sticky": false,
  "format": "aside",
  "categories": [
    1
  ],
  "tags": [
    5
  ],
  "formats": [
    3
  ]
 }
```

#### Modified Result

[](#modified-result-1)

```
{
  "id": 1,
  "date": "2016-02-20T02:09:47",
  "date_gmt": "2016-02-20T02:09:47",
  "guid": {
    "rendered": "http://src.wordpress-develop.dev/?p=1"
  },
  "modified": "2016-05-24T11:34:19",
  "modified_gmt": "2016-05-24T11:34:19",
  "slug": "hello-world",
  "type": "post",
  "link": "/blog/2016/02/20/hello-world/",
  "title": {
    "rendered": "Hello world!",
    "from_content": "Welcome to WordPress. This is your first pos…"
  },
  "content": {
    "rendered": "Welcome to WordPress. This is your first post. Edit or delete it, then start writing!\n"
  },
  "excerpt": {
    "rendered": "Welcome to WordPress. This is your first post. Edit or delete it, then start writing!\n"
  },
  "author": 1,
  "featured_media": 0,
  "comment_status": "open",
  "ping_status": "open",
  "sticky": false,
  "format": "aside",
  "categories": [
    {
      "id": 1,
      "name": "Uncategorized",
      "slug": "uncategorized",
      "description": "",
      "link": "/blog/category/uncategorized/"
    }
  ],
  "tags": [
    {
      "id": 5,
      "name": "misc",
      "slug": "misc",
      "description": "",
      "link": "/blog/tag/misc/"
    }
  ],
  "formats": [
    {
      "id": 3,
      "name": "Aside",
      "slug": "post-format-aside",
      "description": "",
      "link": "/blog/type/aside/"
    }
  ],
  "date_formatted": "February 20, 2016",
  "modified_formatted": "May 24, 2016",
}
```

### Attachments

[](#attachments)

In additions to the modifications above, the result of requests to attachments/media will have these modifications:

- `parent_post` is added.

#### Modified Result

[](#modified-result-2)

```
{
  "parent_post": {
    "id": 1,
    "link": "/blog/2016/02/20/hello-world/",
    "title": {
      "rendered": "Hello world!"
    }
  }
}
```

### Comments

[](#comments)

#### Original Result

[](#original-result-2)

```
{
  "id": 1,
  "post": 1,
  "parent": 0,
  "author": 0,
  "author_name": "Mr WordPress",
  "author_url": "https://wordpress.org/",
  "date": "2016-02-20T02:09:47",
  "date_gmt": "2016-02-20T02:09:47",
  "content": {
    "rendered": "Hi, this is a comment.\nTo delete a comment, just log in and view the post&#039;s comments. There you will have the option to edit or delete them.\n"
  },
  "link": "http://src.wordpress-develop.dev/blog/2016/02/20/hello-world/#comment-1",
  "status": "approved",
  "type": "comment",
  "author_avatar_urls": {
    "24": "http://1.gravatar.com/avatar/?s=24&d=mm&r=g",
    "48": "http://1.gravatar.com/avatar/?s=48&d=mm&r=g",
    "96": "http://2.gravatar.com/avatar/?s=96&d=mm&r=g"
  },
  "_links": {
    "self": [
      {
        "href": "http://src.wordpress-develop.dev/wp-json/wp/v2/comments/1"
      }
    ],
    "collection": [
      {
        "href": "http://src.wordpress-develop.dev/wp-json/wp/v2/comments"
      }
    ],
    "up": [
      {
        "embeddable": true,
        "post_type": "post",
        "href": "http://src.wordpress-develop.dev/wp-json/wp/v2/posts/1"
      }
    ]
  }
}
```

#### Modified Result

[](#modified-result-3)

```
{
  "id": 1,
  "post": 1,
  "parent": 0,
  "author": 0,
  "author_name": "Mr WordPress",
  "author_url": "https://wordpress.org/",
  "date": "2016-02-20T02:09:47",
  "date_gmt": "2016-02-20T02:09:47",
  "content": {
    "rendered": "Hi, this is a comment.\nTo delete a comment, just log in and view the post&#039;s comments. There you will have the option to edit or delete them.\n"
  },
  "link": "/blog/2016/02/20/hello-world/#comment-1",
  "status": "approved",
  "type": "comment",
  "author_avatar_urls": {
    "24": "http://2.gravatar.com/avatar/?s=24&d=mm&r=g",
    "48": "http://1.gravatar.com/avatar/?s=48&d=mm&r=g",
    "96": "http://0.gravatar.com/avatar/?s=96&d=mm&r=g"
  },
  "children_count": 0,
  "date_formatted": "February 20, 2016 at 2:09 am",
  "_links": {
    "self": [
      {
        "href": "http://src.wordpress-develop.dev/wp-json/wp/v2/comments/1"
      }
    ],
    "collection": [
      {
        "href": "http://src.wordpress-develop.dev/wp-json/wp/v2/comments"
      }
    ],
    "up": [
      {
        "embeddable": true,
        "post_type": "post",
        "href": "http://src.wordpress-develop.dev/wp-json/wp/v2/posts/1"
      }
    ]
  }
}
```

Changelog
---------

[](#changelog)

### 0.8.0

[](#080)

- Fix compatibility with WordPress 4.7

### 0.7.0

[](#070)

- Support custom taxonomies

### 0.6.0

[](#060)

- Add `/info` endpoint

### 0.5.0

[](#050)

- Live Preview

### 0.4.0

[](#040)

- Comments mods

### 0.3.0

[](#030)

- Strip `home_url()` from menu items' url.

### 0.2.1

[](#021)

- Add `lang` and `html_dir` to index's response

### 0.2.0

[](#020)

- Remove Menus &amp; Post Formats (now as standalone plugins)

### 0.1.0

[](#010)

- Initial

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~216 days

Recently: every ~431 days

Total

9

Last Release

1950d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f62825bb7b657e26eb23efecc8452480816d859314a3e0df3eb0bdafe034d29a?d=identicon)[kucrut](/maintainers/kucrut)

---

Top Contributors

[![kucrut](https://avatars.githubusercontent.com/u/67838?v=4)](https://github.com/kucrut "kucrut (18 commits)")

---

Tags

wordpressrest

### Embed Badge

![Health badge](/badges/kucrut-bridge/health.svg)

```
[![Health](https://phpackages.com/badges/kucrut-bridge/health.svg)](https://phpackages.com/packages/kucrut-bridge)
```

###  Alternatives

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.3k10](/packages/helsingborg-stad-municipio)[pixelpeter/laravel5-woocommerce-api-client

Laravel 5 wrapper for the Woocommerce REST API

123104.8k](/packages/pixelpeter-laravel5-woocommerce-api-client)[threesquared/laravel-wp-api

Laravel package for the Wordpress JSON REST API

1510.3k](/packages/threesquared-laravel-wp-api)

PHPackages © 2026

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