Skip to content

Conversation

@zoliszabo
Copy link

@zoliszabo zoliszabo commented Oct 24, 2018

Adds possibility to define multiple locations (namespaces) where WpClient can look after endpoints.
This feature is useful where custom, domain-specific endpoints are used.

How to use:

Your new endpoint (notice the namespace):

namespace Your\Special\Endpoint;

use Vnn\WpApiClient\Endpoint\AbstractWpEndpoint; 

class Examples extends AbstractWpEndpoint
{
...
}

And where it is added to WpClient:

$client = new WpClient(...);
$client->addEndpointNamespace('Your\Special\Endpoint\\');
$client->examples()->get(1);

@pekka
Copy link

pekka commented Jan 20, 2023

This PR was a huge help for me today - thank you!

@zoliszabo
Copy link
Author

This PR was a huge help for me today - thank you!

You're welcome! :)

@zack-carlson
Copy link

#29 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants