Title: wp_is_file_mod_allowed
Published: June 15, 2017
Last modified: February 24, 2026

---

# wp_is_file_mod_allowed( string $context ): bool

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/wp_is_file_mod_allowed/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/wp_is_file_mod_allowed/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_is_file_mod_allowed/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/wp_is_file_mod_allowed/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/wp_is_file_mod_allowed/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_is_file_mod_allowed/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_is_file_mod_allowed/?output_format=md#wp--skip-link--target)

Determines whether file modifications are allowed.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/wp_is_file_mod_allowed/?output_format=md#parameters)󠁿

 `$context`stringrequired

The usage context.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/wp_is_file_mod_allowed/?output_format=md#return)󠁿

 bool True if file modification is allowed, false otherwise.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_is_file_mod_allowed/?output_format=md#source)󠁿

    ```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 );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/load.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/load.php#L1827)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/load.php#L1827-L1837)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/wp_is_file_mod_allowed/?output_format=md#hooks)󠁿

 [apply_filters( ‘file_mod_allowed’, bool $file_mod_allowed, string $context )](https://developer.wordpress.org/reference/hooks/file_mod_allowed/)

Filters whether file modifications are allowed.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_is_file_mod_allowed/?output_format=md#related)󠁿

| Uses | Description | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

| Used by | Description | 
| [wp_can_install_language_pack()](https://developer.wordpress.org/reference/functions/wp_can_install_language_pack/)`wp-admin/includes/translation-install.php` |

Check if WordPress has access to the filesystem without asking for credentials.

  | 
| [wp_download_language_pack()](https://developer.wordpress.org/reference/functions/wp_download_language_pack/)`wp-admin/includes/translation-install.php` |

Download a language pack.

  | 
| [WP_Automatic_Updater::is_disabled()](https://developer.wordpress.org/reference/classes/wp_automatic_updater/is_disabled/)`wp-admin/includes/class-wp-automatic-updater.php` |

Determines whether the entire automatic updater is disabled.

  | 
| [map_meta_cap()](https://developer.wordpress.org/reference/functions/map_meta_cap/)`wp-includes/capabilities.php` |

Maps a capability to the primitive capabilities required of the given user to satisfy the capability being checked.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_is_file_mod_allowed/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_is_file_mod_allowed%2F)
before being able to contribute a note or feedback.