2017 © Pedro Peláez
 

library discovery

image

wp-api/discovery

  • Tuesday, December 8, 2015
  • by rmccue
  • Repository
  • 6 Watchers
  • 34 Stars
  • 1,584 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 4 Open issues
  • 1 Versions
  • 5 % Grown

The README.md

WordPress API Discovery

This library allows autodiscovery of the WordPress REST API shipping in WordPress 4.4., (*1)

Installing

This library should be installed via Composer as wp-api/discovery., (*2)

If manually installing (i.e. via git clone), be sure to run composer install after cloning the code., (*3)

Using

The main entry point is the WordPress\Discovery\discover() function. Simply pass in a URL to discover the API., (*4)

/**
 * Discover the WordPress API from a URI.
 *
 * @param string $uri URI to start the search from.
 * @param bool $legacy Should we check for the legacy API too?
 * @return Site|null Site data if available, null if not a WP site.
 */
function discover( $uri, $legacy = false ) {

This project also includes a demo web install:, (*5)

php -S 0.0.0.0:9000 www/index.php

Then access http://localhost:9000/ to view the demo. It looks something like this:, (*6)

, (*7)

License

This project is licensed under the MIT license. See LICENSE.md for the full license., (*8)

The Versions

08/12 2015

dev-master

9999999-dev

  Sources   Download

MIT

The Requires