WooCommerce Code Reference

InstallPlugin extends Step

Class InstallPlugin

This class represents a step in the installation process of a WooCommerce plugin. It includes methods to prepare the data for the plugin installation step and to provide the schema for the JSON representation of this step.

Table of Contents

$meta_values  : array<string|int, mixed>
Meta values for the step.
$options  : array<string|int, mixed>
Additional options for the plugin installation.
$resource  : string
The resource URL or path to the plugin's ZIP file.
$slug  : string
The slug of the plugin to be installed.
__construct()  : mixed
InstallPlugin constructor.
get_json_array()  : mixed
Get the JSON array for the step.
get_schema()  : array<string|int, mixed>
Returns the schema for the JSON representation of this step.
get_step_name()  : string
Returns the name of this step.
prepare_json_array()  : array<string|int, mixed>
Prepares an associative array for JSON encoding.
set_meta_values()  : void
Set meta values for the step.

Properties

Methods

__construct()

InstallPlugin constructor.

public __construct(string $slug, string $resource[, array<string|int, mixed> $options = array() ]) : mixed
Parameters
$slug : string

The slug of the plugin to be installed.

$resource : string

The resource URL or path to the plugin's ZIP file.

$options : array<string|int, mixed> = array()

Additional options for the plugin installation.

Return values
mixed

get_schema()

Returns the schema for the JSON representation of this step.

public static get_schema([int $version = 1 ]) : array<string|int, mixed>
Parameters
$version : int = 1

The version of the schema to return.

Return values
array<string|int, mixed>The schema array.

prepare_json_array()

Prepares an associative array for JSON encoding.

public prepare_json_array() : array<string|int, mixed>
Return values
array<string|int, mixed>Array representing this installation step.

set_meta_values()

Set meta values for the step.

public set_meta_values(array<string|int, mixed> $meta_values) : void
Parameters
$meta_values : array<string|int, mixed>

The meta values.

Return values
void