示例#1
0
 function options_page()
 {
     if (!current_user_can('manage_options')) {
         wp_die(__('You do not have sufficient permissions to access this page.'));
     }
     $ctx = \Timber::get_context();
     if ($_SERVER['REQUEST_METHOD'] == 'GET') {
         $ctx['form'] = Option::get_instance()->get();
     } else {
         $ctx['form'] = $_POST;
         Option::get_instance()->update($_POST);
     }
     \Timber::render('Admin.html', $ctx);
 }
示例#2
0
文件: App.php 项目: hdknr/wp-authmod
 function __construct(array $argument = array())
 {
     parent::__construct($argument);
     $this->admin = Admin::get_instance();
     $this->option = Option::get_instance();
 }