Settings_Command
Settings management commands for CRP.
Namespace: WebberZone\Contextual_Related_Posts\Pro\CLI
Since: 4.2.0
Source: includes/cli/class-settings-command.php line 21
Extends: Base_Command
Methods
export()
Export plugin settings to a file.
OPTIONS
[—file=
EXAMPLES
wp crp settings export
wp crp settings export --file=my-settings.json
Line: 39
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 plugin settings from a file.
OPTIONS
[—merge] : Merge with existing settings instead of replacing.
[—dry-run] : Show what would be imported without making changes.
EXAMPLES
wp crp settings import settings.json
wp crp settings import settings.json --merge
wp crp settings import settings.json --dry-run
Line: 86
public function import( array $args, array $assoc_args ): void;
| Type | Name | Description |
|---|---|---|
array | $args | Command arguments. |
array | $assoc_args | Command associative arguments. |
Returns: void
get()
Get a specific setting value.
OPTIONS
[—format=
EXAMPLES
wp crp settings get cache
wp crp settings get cache --format=json
Line: 144
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=
EXAMPLES
wp crp settings set cache true --type=bool
wp crp settings set limit 10 --type=int
wp crp settings set title "Related Posts"
Line: 199
public function set( array $args, array $assoc_args ): void;
| Type | Name | Description |
|---|---|---|
array | $args | Command arguments. |
array | $assoc_args | Command associative arguments. |
Returns: void