admin = $a; //add_action( 'add_meta_boxes', [$this, 'my_custom_meta_box'] ); if ($a->hasAccess() && ( $a->hasCurrentPostType() ||(isset($_GET['page']) && sanitize_text_field($_GET['page'])=='ai-writing-assistant') ||(isset($_GET['page']) && sanitize_text_field($_GET['page'])=='single-content-generator') ||(isset($_GET['page']) && sanitize_text_field($_GET['page'])=='scheduled-content-generator') ||(isset($_GET['page']) && sanitize_text_field($_GET['page'])=='ai-image-generator') ||(isset($_GET['page']) && sanitize_text_field($_GET['page'])=='chat-gpt-playground') )){ add_action('admin_footer', array($this, 'getpromptHtml')); add_action( 'add_meta_boxes', array($this, 'aiwa_writing_assistant_metabox' )); } } public function aiwa_writing_assistant_metabox() { add_meta_box( 'aiwa_ai_metabox', // Unique ID __('AI Writing Assistant', 'ai-writing-assistant'), // Title array($this, 'aiwa_writing_assistant_metabox_html'), // Callback function array('post', 'page', 'product'), // Screen (post, page, link, attachment, or custom post type) 'side', // Context (normal, advanced, or side) 'high' // Priority (high, core, default, or low) ); } public function aiwa_writing_assistant_metabox_html() { echo ''.__("AI Writing Assistant", "ai-writing-assistant").' '; } public function getpromptHtml() { $placeholders = 'The future of the AI, Will Artificial Intelligence Lead to Job Losses?, Historical places of US, Quantum computing and its applications,Cybersecurity and data privacy,Climate change and its impact on the world,The future of AI,Artificial intelligence and machine learning,Sustainable energy sources and technologies,Global economic trends and forecasting,The future of transportation and mobility,Biotechnology and genetic engineering,The impact of social media on society,Blockchain technology and its uses,The future of healthcare and medicine,Space exploration and colonization,The future of work and the impact of automation,The impact of the internet on education,Virtual reality and its applications,The future of urban development and smart cities,Gaming and its impact on society,The future of food and agriculture'; if (!empty(esc_attr(get_option('aiwa-placeholders', '')))){ $placeholders .= ',' . esc_attr(get_option('aiwa-placeholders', 'The history of AI')); } $title = __('AI/GPT-3 Prompt', 'ai-writing-assistant'); $promptBoxTitle = apply_filters('aiwa_promptbox_title', $title); $key = 'ai_writing_assistant__'; $settingsInclude = apply_filters('aiwa_metabox_settings', array('content_settings', 'advanced_settings', 'response_panel', 'language', 'if_previously_failed', 'super_fast_generation_mode', 'post_title', 'content_structure', 'content_length', 'add_excerpt', 'include_keywords', 'keyword_bold', 'exclude_keywords', 'writing_style', 'writing_tone', 'introduction', 'conclusion', 'cta', 'generate_images', 'select_titles_before_generate', 'save_future')); ?>