Settings_Command
Manage Top 10 plugin settings.
EXAMPLES
# Get a setting value
$ wp top10 settings get cache
# Set a setting value
$ wp top10 settings set cache 1 --type=int
Namespace: WebberZone\Top_Ten\Pro\CLI
Since: 4.3.0
Source: includes/cli/class-settings-command.php line 29
Extends: Base_Command
Methods
get()
Get a specific setting value.
OPTIONS
[—format=
[—network] : Get the setting for all sites in the network.
[—blog-id=
EXAMPLES
wp top10 settings get cache
wp top10 settings get post_count_column --format=json
wp top10 settings get cache --network
Line: 57
public function get( array $args, array $assoc_args ): void;
| Type | Name | Description |
|---|---|---|
array | $args | Command arguments. |
array | $assoc_args | Command associative arguments. |
Returns: void
set()
Set a specific setting value.
OPTIONS
[—type=
[—dry-run] : Show what would change without updating.
[—network] : Set the setting for all sites in the network.
[—blog-id=
EXAMPLES
wp top10 settings set cache 1 --type=int
wp top10 settings set post_title_length 60
wp top10 settings set cache_time 3600 --type=int
wp top10 settings set cache 1 --network
Line: 131
public function set( array $args, array $assoc_args ): void;
| Type | Name | Description |
|---|---|---|
array | $args | Command arguments. |
array | $assoc_args | Command associative arguments. |
Returns: void
export()
Export all Top 10 settings to a JSON file.
OPTIONS
[—file=
[—dry-run] : Show what would be exported without writing the file.
[—network] : Export settings for all sites in the network.
[—blog-id=
EXAMPLES
wp top10 settings export
wp top10 settings export --file=my-settings.json
wp top10 settings export --network
wp top10 settings export --dry-run
Line: 207
public function export( array $args, array $assoc_args ): void;
| Type | Name | Description |
|---|---|---|
array | $args | Command arguments. |
array | $assoc_args | Command associative arguments. |
Returns: void
import()
Import Top 10 settings from a JSON file.
OPTIONS
[—merge] : Merge with existing settings instead of replacing.
[—dry-run] : Show what would be imported without making changes.
[—network] : Import settings for all sites in the network.
[—blog-id=
EXAMPLES
wp top10 settings import settings.json
wp top10 settings import settings.json --merge
wp top10 settings import settings.json --dry-run
wp top10 settings import settings.json --network
Line: 292
public function import( array $args, array $assoc_args ): void;
| Type | Name | Description |
|---|---|---|
array | $args | Command arguments. |
array | $assoc_args | Command associative arguments. |
Returns: void
copy()
Copy settings from one site to another or all sites on a multisite network.
OPTIONS
[—source=
[—destination=
[—dry-run] : Show what would be copied without making changes.
EXAMPLES
# Copy from current site to site 3
$ wp top10 settings copy --destination=3
# Copy from site 2 to sites 3 and 4
$ wp top10 settings copy --source=2 --destination=3,4
# Copy from current site to all other sites
$ wp top10 settings copy --destination=all
# Copy from site 1 to all other sites
$ wp top10 settings copy --source=1 --destination=all
Line: 387
public function copy( array $args, array $assoc_args ): void;
| Type | Name | Description |
|---|---|---|
array | $args | Command arguments. |
array | $assoc_args | Command associative arguments. |
Returns: void