Title: wp_print_file_editor_templates
Published: November 20, 2017
Last modified: April 28, 2025

---

# wp_print_file_editor_templates()

## In this article

 * [Source](https://developer.wordpress.org/reference/functions/wp_print_file_editor_templates/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_print_file_editor_templates/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_print_file_editor_templates/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_print_file_editor_templates/?output_format=md#wp--skip-link--target)

Prints file editor templates (for plugins and themes).

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_print_file_editor_templates/?output_format=md#source)󠁿

    ```php
    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://developer.wordpress.org/advanced-administration/server/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
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/file.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-admin/includes/file.php#L307)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/file.php#L307-L355)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_print_file_editor_templates/?output_format=md#related)󠁿

| Uses | Description | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [_e()](https://developer.wordpress.org/reference/functions/_e/)`wp-includes/l10n.php` |

Displays translated text.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_print_file_editor_templates/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_print_file_editor_templates%2F)
before being able to contribute a note or feedback.