How to add .ini file type to the plugin editor to read and edit?

This code below should work if you add it to your functions.php in your theme:

add_filter( 'editable_extensions', function ( $default_types ) {
    $default_types[] = 'ini';
    return $default_types;
} );

Assumptions:

  • You’re using at least PHP 5.3
  • You’re using at least WordPress 4.9