WPSEO_Utils::allow_system_file_edit()public staticYoast 1.8.0

Check whether file editing is allowed for the .htaccess and robots.txt files.

{@internal current_user_can() checks internally whether a user is on wp-ms and adjusts accordingly.}}

Метод класса: WPSEO_Utils{}

Хуки из метода

Возвращает

true|false.

Использование

$result = WPSEO_Utils::allow_system_file_edit();

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

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

Код WPSEO_Utils::allow_system_file_edit() Yoast 22.4

public static function allow_system_file_edit() {
	$allowed = true;

	if ( current_user_can( 'edit_files' ) === false ) {
		$allowed = false;
	}

	/**
	 * Filter: 'wpseo_allow_system_file_edit' - Allow developers to change whether the editing of
	 * .htaccess and robots.txt is allowed.
	 *
	 * @param bool $allowed Whether file editing is allowed.
	 */
	return apply_filters( 'wpseo_allow_system_file_edit', $allowed );
}