ID, self::META_KEY, true ); // Calculate character count $char_count = $summary ? strlen( wp_strip_all_tags( $summary ) ) : 0; ?>
post_type, array( 'post', 'page' ), true ) ) { return; } wp_enqueue_style( 'ai-answer-toolkit-meta-box', AI_Answer_Toolkit_PLUGIN_URL . 'assets/css/meta-box.css', array(), AI_Answer_Toolkit_VERSION ); wp_enqueue_script( 'ai-answer-toolkit-meta-box', AI_Answer_Toolkit_PLUGIN_URL . 'assets/js/meta-box.js', array( 'jquery' ), AI_Answer_Toolkit_VERSION, true ); wp_localize_script( 'ai-answer-toolkit-meta-box', 'aitkMetaBox', array( 'optimalMin' => 150, 'optimalMax' => 300, ) ); } /** * Get AEO summary for a post. * * @param int $post_id Post ID. * @return string AEO summary content or empty string. */ public static function get_summary( $post_id ) { $summary = get_post_meta( $post_id, self::META_KEY, true ); return $summary ? $summary : ''; } /** * Check if post has AEO summary. * * @param int $post_id Post ID. * @return bool True if summary exists. */ public static function has_summary( $post_id ) { $summary = self::get_summary( $post_id ); return ! empty( $summary ); } } AI_Answer_Toolkit_Meta_Box::init();