WooCommerce -> Woo Viet * * @author htdat * @since 1.0 * */ class WooViet_Admin_Page { /** * @var string The message to display after saving settings */ var $message = ''; /** * WooViet_Admin_Page constructor. */ public function __construct() { // Catch and run the save_settings() action if ( isset( $_REQUEST['wooviet_nonce'] ) && isset ( $_REQUEST['action'] ) && 'wooviet_save_settings' == $_REQUEST['action'] ) { $this->save_settings(); } add_action( 'admin_menu', array( $this, 'register_submenu_page' ) ); } /** * Save settings for the plugin */ public function save_settings() { if ( wp_verify_nonce( $_REQUEST['wooviet_nonce'], 'wooviet_save_settings' ) ) { update_option( 'woo-viet', $_REQUEST['settings'] ); $this->message = '
' . __( 'Settings saved', 'woo-viet' ) . '
' . __( 'Can not save settings! Please refresh this page.', 'woo-viet' ) . '