'; if ( strpos( $content, $verdict_close ) !== false ) { $display = self::render_verification_block( $last_verified ); $content = str_replace( $verdict_close, $verdict_close . $display, $content ); } return $content; } /** * Render the verification block HTML. * * @param string $last_verified ISO date string. * @return string HTML block. */ private static function render_verification_block( string $last_verified ): string { $date_obj = new \DateTime( $last_verified ); $formatted_date = $date_obj->format( get_option( 'date_format' ) ); $html = '
'; $html .= esc_html__( 'Last verified: ', 'peptide-repo-core' ); $html .= sprintf( '', esc_attr( $date_obj->format( 'Y-m-d' ) ), esc_html( $formatted_date ) ); $html .= ' — ' . esc_html__( 'methodology', 'peptide-repo-core' ) . ''; $html .= '
'; return $html; } }