<?php
namespace Wpupgrader\Libraries\WordPress\Plugins\Core\Settings\Page\Callback;

use Wpupgrader\Libraries\WordPress\Plugins\Core\Settings\Page\Callback;

class Page extends Callback
{
    public function callbackAction()
    {
        $argspages = [
            'child_of'     => 0,
            'sort_order'   => 'ASC',
            'sort_column'  => 'post_title',
            'hierarchical' => 1,
            'id'           => $this->getIdString(),
            'name'         => $this->getNameString(),
            'exclude'      => '',
            'include'      => '',
            'meta_key'     => '',
            'meta_value'   => '',
            'authors'      => '',
            'exclude_tree' => '',
            'post_type'    => 'page',
            'selected'     => $this->getValue() //this will have to be the id of the stored page.
        ];
        \wp_dropdown_pages($argspages);
        echo $this->getDescription();
    }
}