The saved questions in stored order; empty when there are none. */ public static function forProduct( int $product_id ): array { $existing_json = get_post_meta( $product_id, '_aipt_faq_data', true ); $existing_faqs = ( is_string( $existing_json ) && '' !== $existing_json ) ? json_decode( $existing_json, true ) : array(); if ( ! is_array( $existing_faqs ) ) { return array(); } $questions = array(); foreach ( $existing_faqs as $faq ) { if ( is_array( $faq ) && isset( $faq['question'] ) && is_string( $faq['question'] ) ) { $questions[] = $faq['question']; } } return $questions; } }