public function validate($input) { // var_dump($input); $using = (int) $input['using']; $formNum = (int) $input['formNum'] >= 1 ? (int) $input['formNum'] : 1; $arr = array(wp_edvisor_template($this->wp_edvisor_options, $input, 0), 'using' => $using, 'formNum' => $formNum); if ($formNum > 1) { for ($x = 1; $x < $formNum; $x++) { array_push($arr, wp_edvisor_template($this->wp_edvisor_options, $input, $x)); } } return $arr; }
<?php /** * Provide a admin area view for the plugin * * This file is used to markup the admin-facing aspects of the plugin. * * @link edvisor.io * @since 1.0.0 * * @package Wp_edvisor * @subpackage Wp_edvisor/admin/partials */ $options = get_option($this->plugin_name); if ($options == false) { $options = array(wp_edvisor_template($this->wp_edvisor_options, $input, 0), 'using' => 0, 'formNum' => 0); } else { $formNum = $options['formNum']; $using = $options['using']; } // var_dump($options); ?> <!-- This file should primarily consist of HTML with a little bit of PHP. --> <div class="wrap"> <h2><?php echo esc_html(get_admin_page_title()); ?> </h2>