wp_get_plugin_file_editable_extensions

The timeline below displays how wordpress function wp_get_plugin_file_editable_extensions has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.9

/**
 * Gets the list of file extensions that are editable in plugins.
 *
 * @since 4.9.0
 *
 * @param string $plugin Path to the plugin file relative to the plugins directory.
 * @return string[] Array of editable file extensions.
 */
function wp_get_plugin_file_editable_extensions($plugin)
{
    $default_types = array('bash', 'conf', 'css', 'diff', 'htm', 'html', 'http', 'inc', 'include', 'js', 'json', 'jsx', 'less', 'md', 'patch', 'php', 'php3', 'php4', 'php5', 'php7', 'phps', 'phtml', 'sass', 'scss', 'sh', 'sql', 'svg', 'text', 'txt', 'xml', 'yaml', 'yml');
    /**
     * Filters the list of file types allowed for editing in the plugin file editor.
     *
     * @since 2.8.0
     * @since 4.9.0 Added the `$plugin` parameter.
     *
     * @param string[] $default_types An array of editable plugin file extensions.
     * @param string   $plugin        Path to the plugin file relative to the plugins directory.
     */
    $file_types = (array) apply_filters('editable_extensions', $default_types, $plugin);
    return $file_types;
}

WordPress Version: 5.5

/**
 * Gets the list of file extensions that are editable in plugins.
 *
 * @since 4.9.0
 *
 * @param string $plugin Path to the plugin file relative to the plugins directory.
 * @return string[] Array of editable file extensions.
 */
function wp_get_plugin_file_editable_extensions($plugin)
{
    $default_types = array('bash', 'conf', 'css', 'diff', 'htm', 'html', 'http', 'inc', 'include', 'js', 'json', 'jsx', 'less', 'md', 'patch', 'php', 'php3', 'php4', 'php5', 'php7', 'phps', 'phtml', 'sass', 'scss', 'sh', 'sql', 'svg', 'text', 'txt', 'xml', 'yaml', 'yml');
    /**
     * Filters the list of file types allowed for editing in the plugin editor.
     *
     * @since 2.8.0
     * @since 4.9.0 Added the `$plugin` parameter.
     *
     * @param string[] $default_types An array of editable plugin file extensions.
     * @param string   $plugin        Path to the plugin file relative to the plugins directory.
     */
    $file_types = (array) apply_filters('editable_extensions', $default_types, $plugin);
    return $file_types;
}

WordPress Version: 5.1

/**
 * Get list of file extensions that are editable in plugins.
 *
 * @since 4.9.0
 *
 * @param string $plugin Path to the plugin file relative to the plugins directory.
 * @return string[] Array of editable file extensions.
 */
function wp_get_plugin_file_editable_extensions($plugin)
{
    $editable_extensions = array('bash', 'conf', 'css', 'diff', 'htm', 'html', 'http', 'inc', 'include', 'js', 'json', 'jsx', 'less', 'md', 'patch', 'php', 'php3', 'php4', 'php5', 'php7', 'phps', 'phtml', 'sass', 'scss', 'sh', 'sql', 'svg', 'text', 'txt', 'xml', 'yaml', 'yml');
    /**
     * Filters file type extensions editable in the plugin editor.
     *
     * @since 2.8.0
     * @since 4.9.0 Added the `$plugin` parameter.
     *
     * @param string[] $editable_extensions An array of editable plugin file extensions.
     * @param string   $plugin              Path to the plugin file relative to the plugins directory.
     */
    $editable_extensions = (array) apply_filters('editable_extensions', $editable_extensions, $plugin);
    return $editable_extensions;
}

WordPress Version: 4.9

/**
 * Get list of file extensions that are editable in plugins.
 *
 * @since 4.9.0
 *
 * @param string $plugin Plugin.
 * @return array File extensions.
 */
function wp_get_plugin_file_editable_extensions($plugin)
{
    $editable_extensions = array('bash', 'conf', 'css', 'diff', 'htm', 'html', 'http', 'inc', 'include', 'js', 'json', 'jsx', 'less', 'md', 'patch', 'php', 'php3', 'php4', 'php5', 'php7', 'phps', 'phtml', 'sass', 'scss', 'sh', 'sql', 'svg', 'text', 'txt', 'xml', 'yaml', 'yml');
    /**
     * Filters file type extensions editable in the plugin editor.
     *
     * @since 2.8.0
     * @since 4.9.0 Adds $plugin param.
     *
     * @param string $plugin Plugin file.
     * @param array $editable_extensions An array of editable plugin file extensions.
     */
    $editable_extensions = (array) apply_filters('editable_extensions', $editable_extensions, $plugin);
    return $editable_extensions;
}