Subprocessors
extends CLICommands
in package
Subprocessors CLI class.
Table of Contents
Properties
- $notices : array<string|int, array{type: string, message: string}>
- WP CLI notices.
- $upload_path : string
- Upload path
- $upload_url : string
- Upload URL
Methods
- __construct() : mixed
- Construct
- add_notice() : void
- Adds a notice to be displayed at the end of the command.
- display_notices() : void
- Display the notices. The output is WP_CLI.
- get_notices() : array<string|int, array{type: string, message: string}>
- Get all notices.
- get_upload_path() : string
- Get the upload path.
- get_upload_url() : string
- Get the upload URL.
- migrate() : void
- Migrates data from a post
- reset_notices() : void
- Reset all notices.
- set_upload_path() : void
- Set the upload path.
- set_upload_url() : void
- Set the upload URL.
- export_csv() : void
- Create and write to a CSV file
- migrate_subscribe_data() : void
- Migrates subscribe data for a given post ID, and removes the legacy email DB table.
Properties
$notices
WP CLI notices.
public
array<string|int, array{type: string, message: string}>
$notices
= array()
$upload_path
Upload path
public
string
$upload_path
$upload_url
Upload URL
public
string
$upload_url
Methods
__construct()
Construct
public
__construct() : mixed
add_notice()
Adds a notice to be displayed at the end of the command.
public
add_notice([string $message = '' ][, string $type = 'log' ]) : void
Parameters
- $message : string = ''
-
The message to display.
- $type : string = 'log'
-
The type of notice. One of 'log', 'success', 'warning', 'error'. Default is 'log'.
display_notices()
Display the notices. The output is WP_CLI.
public
display_notices() : void
get_notices()
Get all notices.
public
get_notices() : array<string|int, array{type: string, message: string}>
Return values
array<string|int, array{type: string, message: string}> —The array of notices.
get_upload_path()
Get the upload path.
public
get_upload_path() : string
Return values
string —The full path.
get_upload_url()
Get the upload URL.
public
get_upload_url() : string
Return values
string —The full URL.
migrate()
Migrates data from a post
public
migrate(array<string|int, string> $args, array<string, mixed> $assoc_args) : void
OPTIONS
<post_id> : The post ID to migrate data from.
EXAMPLES
wp boomi migrate subprocessors subscribe-data 123
Parameters
- $args : array<string|int, string>
-
CLI positional arguments.
- $assoc_args : array<string, mixed>
-
CLI associative arguments.
reset_notices()
Reset all notices.
public
reset_notices() : void
set_upload_path()
Set the upload path.
public
set_upload_path([string $path = '' ]) : void
If the path is a directory, it will create it if it does not exist.
Parameters
- $path : string = ''
-
The complete path to use.
set_upload_url()
Set the upload URL.
public
set_upload_url([string $url = '' ]) : void
Parameters
- $url : string = ''
-
The full URL to use.
export_csv()
Create and write to a CSV file
protected
export_csv(string $filename, array<int|string, mixed> $rows[, array<int|string, string> $headers = array() ]) : void
Parameters
- $filename : string
-
the full name of the file.
- $rows : array<int|string, mixed>
-
array of data.
- $headers : array<int|string, string> = array()
-
(default: array()).
migrate_subscribe_data()
Migrates subscribe data for a given post ID, and removes the legacy email DB table.
private
migrate_subscribe_data(int $post_id) : void
Parameters
- $post_id : int
-
The ID of the post whose subscribe data should be migrated.