Recent

Settings_Command class Pro only

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=] : Path to export file. Default: crp-settings-{timestamp}.json

EXAMPLES

wp crp settings export
wp crp settings export --file=my-settings.json

Line: 39

public function export( array $args, array $assoc_args ): void;
TypeNameDescription
array$argsCommand arguments.
array$assoc_argsCommand associative arguments.

Returns: void

import()

Import plugin settings from a file.

OPTIONS

: Path to import file.

[—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;
TypeNameDescription
array$argsCommand arguments.
array$assoc_argsCommand associative arguments.

Returns: void

get()

Get a specific setting value.

OPTIONS

: Setting key to retrieve.

[—format=] : Output format. Options: table, json, csv, yaml, value. Default: value.

EXAMPLES

wp crp settings get cache
wp crp settings get cache --format=json

Line: 144

public function get( array $args, array $assoc_args ): void;
TypeNameDescription
array$argsCommand arguments.
array$assoc_argsCommand associative arguments.

Returns: void

set()

Set a specific setting value.

OPTIONS

: Setting key to set. : Setting value to set.

[—type=] : Value type. Options: string, int, bool, array. Default: auto-detect.

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;
TypeNameDescription
array$argsCommand arguments.
array$assoc_argsCommand associative arguments.

Returns: void