WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Получай пассивный доход от сайта с помощью браузерных PUSH уведомлений
функция не описана

validate_file_to_edit() WP 1.5.0

Makes sure that the file that was requested to be edited is allowed to be edited.

Function will die if you are not allowed to edit the file.

Хуков нет.


Строку/null. Returns the file name on success, dies on failure.


validate_file_to_edit( $file, $allowed_files );
$file(строка) (обязательный)
File the user is attempting to edit.
Array of allowed files to edit. $file must match an entry exactly.

Список изменений

С версии 1.5.0 Введена.

Код validate_file_to_edit() WP 5.7.1

function validate_file_to_edit( $file, $allowed_files = array() ) {
	$code = validate_file( $file, $allowed_files );

	if ( ! $code ) {
		return $file;

	switch ( $code ) {
		case 1:
			wp_die( __( 'Sorry, that file cannot be edited.' ) );

			// case 2 :
			// wp_die( __('Sorry, can&#8217;t call files with their real path.' ));

		case 3:
			wp_die( __( 'Sorry, that file cannot be edited.' ) );