Current path: home/webdevt/www/cryptoimpot.fr/wp-content/plugins/divi-contact-form-helper/app/Admin/Pages/
?? Go up: /home/webdevt/www/cryptoimpot.fr/wp-content/plugins/divi-contact-form-helper/app/Admin
<?php
namespace KS_PAC_DCFH\Admin\Pages;
use KS_PAC_DCFH\Admin\Controllers\Contact_Forms_List;
if (!defined('ABSPATH')) {
exit;
}
class Page_Contact_Forms
{
public $_page;
public $_table;
public function init(): void
{
$this->_page = isset($_GET['page']) ? sanitize_key($_GET['page']) : null; // phpcs:ignore
add_action('admin_menu', [$this, 'menu']);
}
public function menu(): void
{
$hook_suffix = add_submenu_page('edit.php?post_type=pwh_dcfh', __('Contact Forms', 'divi-contact-form-helper'), __('Forms', 'divi-contact-form-helper'),
'view_forms_pwh_dcfh', 'contact_forms', [$this, 'display_form']);
add_action("load-$hook_suffix", [$this, 'set_screen_options']);
}
public function set_screen_options(): void
{
$this->_table = new Contact_Forms_List();
}
public function display_form(): void
{ ?>
<div class="wrap" id="page-forms-list">
<h1 class="wp-heading-inline"><?php echo esc_html(get_admin_page_title()); ?></h1>
<hr class="wp-header-end">
<span class="spinner"></span>
<form method="get" autocomplete="off">
<?php
$this->_table->prepare_items();
$this->_table->display();
?>
<input type="hidden" name="post_type" value="pwh_dcfh"/>
<input type="hidden" name="page" value="<?php echo esc_attr($this->_page); ?>"/>
<input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('bulk-action-'.$this->_page); // phpcs:ignore
?>"/>
</form>
</div>
<?php
}
}