plugin = ai_seo_article_generator(); $this->init_hooks(); } private function init_hooks() { add_filter('ai_seo_article_generator_generated_content', array($this, 'fix_content_structure'), 5, 2); add_filter('ai_seo_article_generator_content_prompt', array($this, 'enhance_content_prompt_for_html'), 20, 2); } /** * Fix content structure issues */ public function fix_content_structure($content, $data) { // Check if content lacks HTML structure if ($this->content_lacks_html($content)) { $content = $this->add_html_structure($content, $data); } // Fix truncation issues if ($this->is_content_truncated($content, $data)) { $content = $this->complete_truncated_content($content, $data); } // Ensure proper paragraph structure $content = $this->fix_paragraph_structure($content); // Add missing HTML elements $content = $this->add_missing_html_elements($content); return $content; } /** * Enhance content prompt to emphasize HTML structure */ public function enhance_content_prompt_for_html($prompt, $data) { $html_emphasis = "\n\n馃毃 讚专讬砖转 HTML 讞讜讘讛:\n"; $html_emphasis .= "- 讛砖转诪砖 专拽 讘转讙讬讜转 HTML 转拽讬谞讜转:

,

,

,