acf/json/eof_newline

Last updated Apr 4, 2024

Description

Used to change the newline character at the end of JSON files.

Changelog

  • Added in version 6.2.

Parameters

apply_filters( 'acf/json/eof_newline', $newline_character );
  • $newline_character (string) The current newline character, PHP_EOL by default.

Example

This example demonstrates how to change the newline character at the end of JSON files.

functions.php

<?php

function custom_acf_json_eof_newline( $newline_character ) {
    return "\r\n";
}
add_filter( 'acf/json/eof_newline', 'custom_acf_json_eof_newline' );