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

Programmatically set the domains list #56

@straube

Description

@straube

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions