WP_Filesystem_Base::chown( string $file, string|int $owner, bool $recursive = false )

Changes the owner of a file or directory.

Description Description

Default behavior is to do nothing, override this in your subclass, if desired.

Top ↑

Parameters Parameters


(string) (Required) Path to the file or directory.


(string|int) (Required) A user name or number.


(bool) (Optional) If set to true, changes file owner recursively.

Default value: false

Top ↑

Return Return

(bool) True on success, false on failure.

Top ↑

Source Source

File: wp-admin/includes/class-wp-filesystem-base.php

	public function chown( $file, $owner, $recursive = false ) {
		return false;

Top ↑

Changelog Changelog

Version Description
2.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

Top ↑

You must log in before being able to contribute a note or feedback.