Skip to content

Commit f0ab952

Browse files
committed
Remove autoloader from source, and add to documentation
1 parent 0f133fb commit f0ab952

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

example.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
2+
// Make sure you run `composer install`!
3+
require_once 'vendor/autoload.php';
24

35
// include the library.
46
require_once( 'wds-wp-rest-api-connect.php' );

readme.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@ A tool for connecting to the [REST API for WordPress](https://github.com/WP-API/
55

66
To get started, you'll need to install both the [WP REST API plugin](https://github.com/WP-API/WP-API) and the [OAuth plugin](https://github.com/WP-API/OAuth1).
77

8-
To use this library, you will need to run `composer install` from the root of the library, and then include the main library file, `wds-wp-rest-api-connect.php` from your plugin/theme.
8+
To use this library, you will need to run `composer install` from the root of the library, and then include the main library file, `wds-wp-rest-api-connect.php` and the composer autoloader, `vendor/autoload.php` from your plugin/theme.
99

1010
Once installed and activated, you'll need to create a '[Client Application](http://v2.wp-api.org/guide/authentication/#oauth-authentication)'.
1111
When you have the Client key and secret, you'll create a new `WDS_WP_REST_API\OAuth1\Connect` object by passing those credentials along with the REST API URL and the registered callback URL:
1212
```php
13+
// Make sure you run `composer install`!
14+
require_once 'vendor/autoload.php';
15+
16+
// include the library.
17+
require_once( 'wds-wp-rest-api-connect.php' );
18+
1319
// Get the connect object
1420
$api_connect = new WDS_WP_REST_API\OAuth1\Connect();
1521

wds-wp-rest-api-connect.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010

1111
if ( ! class_exists( 'WDS_WP_REST_API\OAuth1\Connect' ) ) :
1212

13-
// Make sure you run `composer install`!
14-
require_once dirname( __FILE__ ) . '/vendor/autoload.php';
15-
1613
/**
1714
* Connect to the WordPress REST API over OAuth1
1815
*

0 commit comments

Comments
 (0)