# wp_ajax_edit_theme_plugin_file()

URL: https://chugunov.pro/api-wordpress/functions/wp_ajax_edit_theme_plugin_file/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 4.9.0.

## Сигнатура

```php
wp_ajax_edit_theme_plugin_file()
```

## Описание

См. alsowp_edit_theme_plugin_file()

## Исходный код

Файл: `wp-admin/includes/ajax-actions.php:4910`

```php
function wp_ajax_edit_theme_plugin_file() {
	$edit_result = wp_edit_theme_plugin_file( wp_unslash( $_POST ) ); // Validation of args is done in wp_edit_theme_plugin_file().

	if ( is_wp_error( $edit_result ) ) {
		wp_send_json_error(
			array_merge(
				array(
					'code'    => $edit_result->get_error_code(),
					'message' => $edit_result->get_error_message(),
				),
				(array) $edit_result->get_error_data()
			)
		);
	} else {
		wp_send_json_success(
			array(
				'message' => __( 'File edited successfully.' ),
			)
		);
	}
}
```

## История изменений

- 4.9.0 — Introduced.

## Связанные

Использует: [`wp_edit_theme_plugin_file`](https://chugunov.pro/api-wordpress/functions/wp_edit_theme_plugin_file/), [`__`](https://chugunov.pro/api-wordpress/functions/__/), [`wp_unslash`](https://chugunov.pro/api-wordpress/functions/wp_unslash/), [`wp_send_json_error`](https://chugunov.pro/api-wordpress/functions/wp_send_json_error/), [`wp_send_json_success`](https://chugunov.pro/api-wordpress/functions/wp_send_json_success/), [`is_wp_error`](https://chugunov.pro/api-wordpress/functions/is_wp_error/).

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/wp_ajax_edit_theme_plugin_file/
