ASYNC_DEFAULT_ARTICLE_IMAGE, ); $Awechat_option_name = defined(AWECHAT_PLUGIN_OPTIONNAME) ? AWECHAT_PLUGIN_OPTIONNAME : 'Awechat_setting'; $Awechat_options = get_option( $Awechat_option_name ); if ($Awechat_options) { $options['article_cover_image'] = $Awechat_options['article_cover_image']; $options['title_prefix'] = $Awechat_options['title_prefix']; } update_option( ASYNC_PLUGIN_OPTIONNAME, $options ); } public function settings_init(){ register_setting( ASYNC_PLUGIN_OPTIONNAME, ASYNC_PLUGIN_OPTIONNAME ); } public function add_plugin_page(){ // This page will be under "Settings" $page_title=__('Async Settings', 'Async'); $menu_title=__('Async Settings', 'Async'); $capability='manage_options'; $menu_slug='Async_setting'; add_options_page( $page_title, $menu_title, $capability, $menu_slug, array( $this, 'create_admin_page' ) ); } public function create_admin_page(){ // Set class property $options = get_option( ASYNC_PLUGIN_OPTIONNAME ); $interface_url = $options['token']!=''?home_url().'/?'.$options['token']:'none'; wp_enqueue_media(); wp_register_script('Async-custom-upload', ASYNC_PLUGIN_URL.'/assets/media_upload.js', array('jquery','media-upload','thickbox'),"2.0"); wp_enqueue_script('Async-custom-upload'); ?>