wp_is_file_mod_allowed() WordPress Function

The wp_is_file_mod_allowed() function checks whether the current user is allowed to modify a specified file. This function is typically used to check whether the user is allowed to upload files to the WordPress site.

wp_is_file_mod_allowed( string $context ) #

Determines whether file modifications are allowed.


Parameters

$context

(string)(Required)The usage context.


Top ↑

Return

(bool) True if file modification is allowed, false otherwise.


Top ↑

Source

File: wp-includes/load.php

function wp_is_file_mod_allowed( $context ) {
	/**
	 * Filters whether file modifications are allowed.
	 *
	 * @since 4.8.0
	 *
	 * @param bool   $file_mod_allowed Whether file modifications are allowed.
	 * @param string $context          The usage context.
	 */
	return apply_filters( 'file_mod_allowed', ! defined( 'DISALLOW_FILE_MODS' ) || ! DISALLOW_FILE_MODS, $context );
}


Top ↑

Changelog

Changelog
VersionDescription
4.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.