The network_step1() WordPress PHP function prints step 1 for Network installation process.
Usage
network_step1($errors);
Custom Example
$errors = new WP_Error('example_error', 'This is an example error message.'); network_step1($errors);
Parameters
$errors
(false|WP_Error) – Optional Error object. Default: false.
More information
See WordPress Developer Resources: network_step1
Examples
Display Network Step 1 with no errors
This example displays the first step of the Network installation process without any errors.
network_step1();
Display Network Step 1 with a custom error message
This example displays the first step of the Network installation process with a custom error message.
$error_message = new WP_Error('custom_error', 'There was a problem during installation.'); network_step1($error_message);
Check if there are errors before displaying Network Step 1
In this example, we first check if there are any errors before displaying the first step of the Network installation process.
$errors = new WP_Error('example_error', 'This is an example error message.'); if (!$errors->has_errors()) { network_step1(); } else { network_step1($errors); }
Display Network Step 1 and add an error afterwards
This example displays the first step of the Network installation process and then adds an error.
$errors = new WP_Error(); network_step1($errors); $errors->add('example_error', 'This is an example error message.');
Display multiple errors in Network Step 1
This example displays the first step of the Network installation process with multiple error messages.
$errors = new WP_Error(); $errors->add('error_1', 'This is the first error message.'); $errors->add('error_2', 'This is the second error message.'); network_step1($errors);