" (which would end the PHP block) and line breaks out. * * @param string $text Text. * @return string */ public static function comment( string $text ): string { $text = (string) preg_replace( '/[^A-Za-z0-9 _.,:\/\\\\-]+/', ' ', $text ); return trim( (string) preg_replace( '/\s+/', ' ', $text ) ); } /** * The get_field() call that reads a field. * * @param string $field_name Field name. * @param string $post_id PHP expression of the post ID, or '' for the current post. * @return string */ public static function get_field( string $field_name, string $post_id = '' ): string { $args = self::string( $field_name ); if ( '' !== $post_id ) { $args .= ', ' . $post_id; } return 'get_field( ' . $args . ' )'; } }