wp_print_file_editor_templates

The timeline below displays how wordpress function wp_print_file_editor_templates has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.3

/**
 * Prints file editor templates (for plugins and themes).
 *
 * @since 4.9.0
 */
function wp_print_file_editor_templates()
{
    ?>
	<script type="text/html" id="tmpl-wp-file-editor-notice">
		<div class="notice inline notice-{{ data.type || 'info' }} {{ data.alt ? 'notice-alt' : '' }} {{ data.dismissible ? 'is-dismissible' : '' }} {{ data.classes || '' }}">
			<# if ( 'php_error' === data.code ) { #>
				<p>
					<?php 
    printf(
        /* translators: 1: Line number, 2: File path. */
        __('Your PHP code changes were not applied due to an error on line %1$s of file %2$s. Please fix and try saving again.'),
        '{{ data.line }}',
        '{{ data.file }}'
    );
    ?>
				</p>
				<pre>{{ data.message }}</pre>
			<# } else if ( 'file_not_writable' === data.code ) { #>
				<p>
					<?php 
    printf(
        /* translators: %s: Documentation URL. */
        __('You need to make this file writable before you can save your changes. See <a href="%s">Changing File Permissions</a> for more information.'),
        __('https://wordpress.org/documentation/article/changing-file-permissions/')
    );
    ?>
				</p>
			<# } else { #>
				<p>{{ data.message || data.code }}</p>

				<# if ( 'lint_errors' === data.code ) { #>
					<p>
						<# var elementId = 'el-' + String( Math.random() ); #>
						<input id="{{ elementId }}"  type="checkbox">
						<label for="{{ elementId }}"><?php 
    _e('Update anyway, even though it might break your site?');
    ?></label>
					</p>
				<# } #>
			<# } #>
			<# if ( data.dismissible ) { #>
				<button type="button" class="notice-dismiss"><span class="screen-reader-text">
					<?php 
    /* translators: Hidden accessibility text. */
    _e('Dismiss');
    ?>
				</span></button>
			<# } #>
		</div>
	</script>
	<?php 
}

WordPress Version: 6.2

/**
 * Prints file editor templates (for plugins and themes).
 *
 * @since 4.9.0
 */
function wp_print_file_editor_templates()
{
    ?>
	<script type="text/html" id="tmpl-wp-file-editor-notice">
		<div class="notice inline notice-{{ data.type || 'info' }} {{ data.alt ? 'notice-alt' : '' }} {{ data.dismissible ? 'is-dismissible' : '' }} {{ data.classes || '' }}">
			<# if ( 'php_error' === data.code ) { #>
				<p>
					<?php 
    printf(
        /* translators: 1: Line number, 2: File path. */
        __('Your PHP code changes were rolled back due to an error on line %1$s of file %2$s. Please fix and try saving again.'),
        '{{ data.line }}',
        '{{ data.file }}'
    );
    ?>
				</p>
				<pre>{{ data.message }}</pre>
			<# } else if ( 'file_not_writable' === data.code ) { #>
				<p>
					<?php 
    printf(
        /* translators: %s: Documentation URL. */
        __('You need to make this file writable before you can save your changes. See <a href="%s">Changing File Permissions</a> for more information.'),
        __('https://wordpress.org/documentation/article/changing-file-permissions/')
    );
    ?>
				</p>
			<# } else { #>
				<p>{{ data.message || data.code }}</p>

				<# if ( 'lint_errors' === data.code ) { #>
					<p>
						<# var elementId = 'el-' + String( Math.random() ); #>
						<input id="{{ elementId }}"  type="checkbox">
						<label for="{{ elementId }}"><?php 
    _e('Update anyway, even though it might break your site?');
    ?></label>
					</p>
				<# } #>
			<# } #>
			<# if ( data.dismissible ) { #>
				<button type="button" class="notice-dismiss"><span class="screen-reader-text">
					<?php 
    /* translators: Hidden accessibility text. */
    _e('Dismiss');
    ?>
				</span></button>
			<# } #>
		</div>
	</script>
	<?php 
}

WordPress Version: 5.5

/**
 * Prints file editor templates (for plugins and themes).
 *
 * @since 4.9.0
 */
function wp_print_file_editor_templates()
{
    ?>
	<script type="text/html" id="tmpl-wp-file-editor-notice">
		<div class="notice inline notice-{{ data.type || 'info' }} {{ data.alt ? 'notice-alt' : '' }} {{ data.dismissible ? 'is-dismissible' : '' }} {{ data.classes || '' }}">
			<# if ( 'php_error' === data.code ) { #>
				<p>
					<?php 
    printf(
        /* translators: 1: Line number, 2: File path. */
        __('Your PHP code changes were rolled back due to an error on line %1$s of file %2$s. Please fix and try saving again.'),
        '{{ data.line }}',
        '{{ data.file }}'
    );
    ?>
				</p>
				<pre>{{ data.message }}</pre>
			<# } else if ( 'file_not_writable' === data.code ) { #>
				<p>
					<?php 
    printf(
        /* translators: %s: Documentation URL. */
        __('You need to make this file writable before you can save your changes. See <a href="%s">Changing File Permissions</a> for more information.'),
        __('https://wordpress.org/support/article/changing-file-permissions/')
    );
    ?>
				</p>
			<# } else { #>
				<p>{{ data.message || data.code }}</p>

				<# if ( 'lint_errors' === data.code ) { #>
					<p>
						<# var elementId = 'el-' + String( Math.random() ); #>
						<input id="{{ elementId }}"  type="checkbox">
						<label for="{{ elementId }}"><?php 
    _e('Update anyway, even though it might break your site?');
    ?></label>
					</p>
				<# } #>
			<# } #>
			<# if ( data.dismissible ) { #>
				<button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php 
    _e('Dismiss');
    ?></span></button>
			<# } #>
		</div>
	</script>
	<?php 
}

WordPress Version: 5.3

/**
 * Print file editor templates (for plugins and themes).
 *
 * @since 4.9.0
 */
function wp_print_file_editor_templates()
{
    ?>
	<script type="text/html" id="tmpl-wp-file-editor-notice">
		<div class="notice inline notice-{{ data.type || 'info' }} {{ data.alt ? 'notice-alt' : '' }} {{ data.dismissible ? 'is-dismissible' : '' }} {{ data.classes || '' }}">
			<# if ( 'php_error' === data.code ) { #>
				<p>
					<?php 
    printf(
        /* translators: 1: Line number, 2: File path. */
        __('Your PHP code changes were rolled back due to an error on line %1$s of file %2$s. Please fix and try saving again.'),
        '{{ data.line }}',
        '{{ data.file }}'
    );
    ?>
				</p>
				<pre>{{ data.message }}</pre>
			<# } else if ( 'file_not_writable' === data.code ) { #>
				<p>
					<?php 
    printf(
        /* translators: %s: Documentation URL. */
        __('You need to make this file writable before you can save your changes. See <a href="%s">Changing File Permissions</a> for more information.'),
        __('https://wordpress.org/support/article/changing-file-permissions/')
    );
    ?>
				</p>
			<# } else { #>
				<p>{{ data.message || data.code }}</p>

				<# if ( 'lint_errors' === data.code ) { #>
					<p>
						<# var elementId = 'el-' + String( Math.random() ); #>
						<input id="{{ elementId }}"  type="checkbox">
						<label for="{{ elementId }}"><?php 
    _e('Update anyway, even though it might break your site?');
    ?></label>
					</p>
				<# } #>
			<# } #>
			<# if ( data.dismissible ) { #>
				<button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php 
    _e('Dismiss');
    ?></span></button>
			<# } #>
		</div>
	</script>
	<?php 
}

WordPress Version: 5.1

/**
 * Print file editor templates (for plugins and themes).
 *
 * @since 4.9.0
 */
function wp_print_file_editor_templates()
{
    ?>
	<script type="text/html" id="tmpl-wp-file-editor-notice">
		<div class="notice inline notice-{{ data.type || 'info' }} {{ data.alt ? 'notice-alt' : '' }} {{ data.dismissible ? 'is-dismissible' : '' }} {{ data.classes || '' }}">
			<# if ( 'php_error' === data.code ) { #>
				<p>
					<?php 
    printf(
        /* translators: 1: line number, 2: file path */
        __('Your PHP code changes were rolled back due to an error on line %1$s of file %2$s. Please fix and try saving again.'),
        '{{ data.line }}',
        '{{ data.file }}'
    );
    ?>
				</p>
				<pre>{{ data.message }}</pre>
			<# } else if ( 'file_not_writable' === data.code ) { #>
				<p><?php 
    _e('You need to make this file writable before you can save your changes. See <a href="https://codex.wordpress.org/Changing_File_Permissions">the Codex</a> for more information.');
    ?></p>
			<# } else { #>
				<p>{{ data.message || data.code }}</p>

				<# if ( 'lint_errors' === data.code ) { #>
					<p>
						<# var elementId = 'el-' + String( Math.random() ); #>
						<input id="{{ elementId }}"  type="checkbox">
						<label for="{{ elementId }}"><?php 
    _e('Update anyway, even though it might break your site?');
    ?></label>
					</p>
				<# } #>
			<# } #>
			<# if ( data.dismissible ) { #>
				<button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php 
    _e('Dismiss');
    ?></span></button>
			<# } #>
		</div>
	</script>
	<?php 
}

WordPress Version: 4.9

/**
 * Print file editor templates (for plugins and themes).
 *
 * @since 4.9.0
 */
function wp_print_file_editor_templates()
{
    ?>
	<script type="text/html" id="tmpl-wp-file-editor-notice">
		<div class="notice inline notice-{{ data.type || 'info' }} {{ data.alt ? 'notice-alt' : '' }} {{ data.dismissible ? 'is-dismissible' : '' }} {{ data.classes || '' }}">
			<# if ( 'php_error' === data.code ) { #>
				<p>
					<?php 
    printf(
        /* translators: %$1s is line number and %1$s is file path. */
        __('Your PHP code changes were rolled back due to an error on line %1$s of file %2$s. Please fix and try saving again.'),
        '{{ data.line }}',
        '{{ data.file }}'
    );
    ?>
				</p>
				<pre>{{ data.message }}</pre>
			<# } else if ( 'file_not_writable' === data.code ) { #>
				<p><?php 
    _e('You need to make this file writable before you can save your changes. See <a href="https://codex.wordpress.org/Changing_File_Permissions">the Codex</a> for more information.');
    ?></p>
			<# } else { #>
				<p>{{ data.message || data.code }}</p>

				<# if ( 'lint_errors' === data.code ) { #>
					<p>
						<# var elementId = 'el-' + String( Math.random() ); #>
						<input id="{{ elementId }}"  type="checkbox">
						<label for="{{ elementId }}"><?php 
    _e('Update anyway, even though it might break your site?');
    ?></label>
					</p>
				<# } #>
			<# } #>
			<# if ( data.dismissible ) { #>
				<button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php 
    _e('Dismiss');
    ?></span></button>
			<# } #>
		</div>
	</script>
	<?php 
}