Documentation

WscCli
in package

Table of Contents

Properties

$hooksRegistered  : bool
$lastMessage  : string|null
$lastProgress  : int|null

Methods

flushAllSites()  : void
Flush and repopulate collections for all sites or a subset.
flushSite()  : void
Flush and repopulate collections for a single site.
flushUnlock()  : void
Remove the flush lock file if a previous run was interrupted.
handleProgressMessageUpdate()  : void
handleProgressUpdate()  : void
register()  : void
Register WP-CLI commands.
buildSkipOptions()  : array<string|int, mixed>
isFlushLocked()  : bool
parseSiteIds()  : array<string|int, mixed>
registerProgressHooks()  : void

Properties

$hooksRegistered

private static bool $hooksRegistered = false

$lastMessage

private static string|null $lastMessage = null

$lastProgress

private static int|null $lastProgress = null

Methods

flushAllSites()

Flush and repopulate collections for all sites or a subset.

public static flushAllSites(array<string|int, mixed> $args, array<string|int, mixed> $assoc_args) : void

Examples:

  • wp wsc flush-all-sites
  • wp wsc flush-all-sites --site-ids=2,5,7
  • wp wsc flush-all-sites --skip-attributes --skip-external-products
Parameters
$args : array<string|int, mixed>
$assoc_args : array<string|int, mixed>

flushSite()

Flush and repopulate collections for a single site.

public static flushSite(array<string|int, mixed> $args, array<string|int, mixed> $assoc_args) : void

Examples:

  • wp wsc flush-site --site-id=3
  • wp wsc flush-site --site-id=3 --skip-attributes --skip-products
Parameters
$args : array<string|int, mixed>
$assoc_args : array<string|int, mixed>

flushUnlock()

Remove the flush lock file if a previous run was interrupted.

public static flushUnlock(array<string|int, mixed> $args, array<string|int, mixed> $assoc_args) : void

Example:

  • wp wsc flush-unlock
Parameters
$args : array<string|int, mixed>
$assoc_args : array<string|int, mixed>

handleProgressMessageUpdate()

public static handleProgressMessageUpdate(mixed $old, mixed $new) : void
Parameters
$old : mixed
$new : mixed

handleProgressUpdate()

public static handleProgressUpdate(mixed $old, mixed $new) : void
Parameters
$old : mixed
$new : mixed

register()

Register WP-CLI commands.

public static register() : void

Examples:

  • wp wsc flush-site --site-id=3
  • wp wsc flush-site --site-id=3 --skip-attributes --skip-products
  • wp wsc flush-all-sites
  • wp wsc flush-all-sites --site-ids=2,5,7 --skip-external-products

buildSkipOptions()

private static buildSkipOptions(array<string|int, mixed> $assoc_args) : array<string|int, mixed>
Parameters
$assoc_args : array<string|int, mixed>
Return values
array<string|int, mixed>

isFlushLocked()

private static isFlushLocked() : bool
Return values
bool

parseSiteIds()

private static parseSiteIds(array<string|int, mixed> $assoc_args) : array<string|int, mixed>
Parameters
$assoc_args : array<string|int, mixed>
Return values
array<string|int, mixed>

registerProgressHooks()

private static registerProgressHooks() : void

        
On this page

Search results