/** * Get api category from wpem category * * @param string $wpem_cat * * @return bool|string */ private function get_api_cat($wpem_cat) { $list = wpem_get_site_industry_slugs_to('api_cat'); if (isset($list[$wpem_cat])) { return $list[$wpem_cat]; } return false; }
/** * Step init */ protected function init() { $fields = [['name' => 'wpem_site_type', 'label' => __('Type', 'wp-easy-mode'), 'type' => 'radio', 'sanitizer' => 'sanitize_key', 'description' => __('What type of website would you like to create?', 'wp-easy-mode'), 'value' => wpem_get_site_type(), 'required' => true, 'choices' => ['standard' => __('Website + Blog', 'wp-easy-mode'), 'blog' => __('Blog only', 'wp-easy-mode'), 'store' => __('Online Store', 'wp-easy-mode')]], ['name' => 'wpem_site_industry', 'label' => __('Industry', 'wp-easy-mode'), 'type' => 'select', 'sanitizer' => 'sanitize_key', 'description' => __('What will your website be about?', 'wp-easy-mode'), 'value' => wpem_get_site_industry(), 'required' => true, 'choices' => wpem_get_site_industry_slugs_to('label')], ['name' => 'blogname', 'label' => __('Title', 'wp-easy-mode'), 'type' => 'text', 'sanitizer' => function ($value) { return stripcslashes(sanitize_option('blogname', $value)); }, 'description' => __('The title of your website appears at the top of all pages and in search results.', 'wp-easy-mode'), 'value' => get_option('blogname'), 'required' => true, 'atts' => ['placeholder' => __('Enter your website title here', 'wp-easy-mode')]], ['name' => 'blogdescription', 'label' => __('Tagline', 'wp-easy-mode'), 'type' => 'text', 'sanitizer' => function ($value) { return stripcslashes(sanitize_option('blogdescription', $value)); }, 'description' => __('Think of the tagline as a slogan that describes what makes your website special. It will also appear in search results.', 'wp-easy-mode'), 'value' => get_option('blogdescription'), 'required' => true, 'atts' => ['placeholder' => __('Enter your website tagline here', 'wp-easy-mode')]]]; $this->fields = new Fields($fields); add_action('wpem_template_notices', [$this->fields, 'error_notice']); }