Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

Programmatically set the domains list #56

Closed
straube opened this issue Apr 19, 2019 · 1 comment
Closed

Programmatically set the domains list #56

straube opened this issue Apr 19, 2019 · 1 comment
Labels
Milestone

Comments

@straube
Copy link
Owner

straube commented Apr 19, 2019

Based on this conversation https://wordpress.org/support/topic/hook-get_optionmultiple-domain-domains/ it would nice to have a way to programmatically set the list of domains. This may be useful for complex setups, especially when a large number of domains is involved.

I'm thinking of having the following new methods:

MultipleDomain::resetDomains(): void

This method would reset the list of domains to have only the original domain. The original domain is required to avoid an empty list.

MultipleDomain::addDomain(
    string $domain,
    string $base = null,
    string $lang = null,
    $protocol = 'auto'
): void

Calling this method will add a new domain to the list. If the domain already exists, it'll be override.

MultipleDomain::storeDomains(): void

Resetting or adding domains to the list wouldn't affect the actual options in the database. To persist the changes into the WordPress' options table, one should call this method.

Any suggestions?

@straube straube added this to the 1.0 milestone Apr 19, 2019
@straube
Copy link
Owner Author

straube commented Apr 26, 2019

The API methods were pushed to master and should be released in the next week with 1.0.0. 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant