current_section = $current_section; $this->keywordRepository = new ContaiKeywordRepository(); $this->init_menu_items(); } private function init_menu_items(): void { $this->menu_items = array( 'keyword-extractor' => array( 'title' => __( 'Keyword Extractor', '1platform-content-ai' ), 'icon' => 'dashicons-search', 'badge' => null, ), 'post-generator' => array( 'title' => __( 'Post Generator', '1platform-content-ai' ), 'icon' => 'dashicons-edit', 'badge' => null, ), 'keywords-list' => array( 'title' => __( 'Keywords List', '1platform-content-ai' ), 'icon' => 'dashicons-list-view', 'badge' => $this->get_keywords_count(), ), 'post-maintenance' => array( 'title' => __( 'Post Maintenance', '1platform-content-ai' ), 'icon' => 'dashicons-admin-tools', 'badge' => $this->get_posts_count(), ), 'generate-comments' => array( 'title' => __( 'Generate Comments', '1platform-content-ai' ), 'icon' => 'dashicons-admin-comments', 'badge' => null, ), 'legal-pages' => array( 'title' => __( 'Legal Pages', '1platform-content-ai' ), 'icon' => 'dashicons-media-text', 'badge' => null, ), ); } private function get_keywords_count(): int { return $this->keywordRepository->count(); } private function get_posts_count(): int { $count = wp_count_posts( 'post' ); return (int) ( $count->publish ?? 0 ); } public function render(): void { ?> current_section === $slug; $item_class = $is_active ? 'is-active' : ''; $url = add_query_arg( 'section', $slug, admin_url( 'admin.php?page=contai-content-generator' ) ); ?>
  • 0 ) : ?>