get_real_file_to_edit

Definition:
function get_real_file_to_edit( $file ) {}

Get the real file system path to a file to edit within the admin
If the $file is index.php or .htaccess this function will assume it is relative to the install root, otherwise it is assumed the file is relative to the wp-content directory

Parameters

  • string $file: filesystem path relative to the WordPress install directory or to the wp-content directory

Return values

returns:full file system path to edit

Source code

function get_real_file_to_edit( $file ) {

	if ('index.php' == $file || '.htaccess' == $file ) {

		$real_file = get_home_path() . $file;

	} else {

		$real_file = WP_CONTENT_DIR . $file;

	}



	return $real_file;

}

1657

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: