Class EDD_API
EDD_API Class
Renders API returns as a JSON/XML array
Methods summary
public
|
#
__construct( )
Setup the EDD API
Author
Daniel J Griffiths
Since
1.5
|
public
|
#
add_endpoint( array $rewrite_rules )
Registers a new rewrite endpoint for accessing the API
Registers a new rewrite endpoint for accessing the API
Parameters
- $rewrite_rules
array $rewrite_rules WordPress Rewrite Rules
Author
Daniel J Griffiths
Since
1.5
|
public
array
|
#
query_vars( array $vars )
Registers query vars for API access
Registers query vars for API access
Parameters
- $vars
array $vars Query vars
Returns
array $vars New query vars
Author
Daniel J Griffiths
Since
1.5
|
public
mixed
|
#
get_user( integer $key = '' )
Retrieve the user ID based on the public key provided
Retrieve the user ID based on the public key provided
Parameters
- $key
integer $key Public Key
Returns
mixed string if user ID is found, false otherwise
Since
1.5.1
|
public
|
#
missing_auth( )
Displays a missing authentication error if all the parameters aren't
provided
Displays a missing authentication error if all the parameters aren't
provided
Author
Daniel J Griffiths
Since
1.5
Uses
|
public
|
#
invalid_auth( )
Displays an authentication failed error if the user failed to provide valid
credentials
Displays an authentication failed error if the user failed to provide valid
credentials
Since
1.5
Uses
|
public
|
#
invalid_key( )
Displays an invalid API key error if the API key provided couldn't be
validated
Displays an invalid API key error if the API key provided couldn't be
validated
Author
Daniel J Griffiths
Since
1.5
Uses
|
public
|
#
process_query( )
Listens for the API and then processes the API requests
Listens for the API and then processes the API requests
Author
Daniel J Griffiths
Since
1.5
|
public
array
|
#
get_customers( integer $customer = null )
Process Get Customers API Request
Process Get Customers API Request
Parameters
- $customer
integer $customer Customer ID
Returns
array $customers Multidimensional array of the customers
Author
Daniel J Griffiths
Since
1.5
|
public
array
|
#
get_products( integer $product = null )
Process Get Products API Request
Process Get Products API Request
Parameters
- $product
integer $product Product (Download) ID
Returns
array $customers Multidimensional array of the products
Author
Daniel J Griffiths
Since
1.5
|
public
|
#
get_stats( array $args = array() )
Process Get Stats API Request
Process Get Stats API Request
Parameters
- $args
array $args Arguments provided by API Request
Author
Daniel J Griffiths
Since
1.5
|
public
array
|
|
public
|
#
output( array $data )
Output Query in either JSON/XML. The query data is outputted as JSON by
default
Output Query in either JSON/XML. The query data is outputted as JSON by
default
Parameters
Author
Daniel J Griffiths
Since
1.5
Used by
|
public
|
#
user_key_field( object $user )
Modify User Profile
Modifies the output of profile.php to add key generation/revocation
Parameters
- $user
object $user Current user info
Author
Daniel J Griffiths
Since
1.5
|
public
|
#
update_key( integer $user_id )
Generate and Save API key
Generate and Save API key
Generates the key requested by user_key_field and stores it in the
database
Parameters
Author
Daniel J Griffiths
Since
1.5
|
Magic methods summary