wp_get_plugin_file_editable_extensions example

                    'plugin' => $plugin,
                    'file'   => $file,
                ),
                admin_url( 'plugin-editor.php' )
            )
        );
        exit;
    }
}

// List of allowable extensions. $editable_extensions = wp_get_plugin_file_editable_extensions( $plugin );

if ( ! is_file( $real_file ) ) {
    wp_die( sprintf( '<p>%s</p>', __( 'File does not exist! Please double check the name and try again.' ) ) );
} else {
    // Get the extension of the file.     if ( preg_match( '/\.([^.]+)$/', $real_file$matches ) ) {
        $ext = strtolower( $matches[1] );
        // If extension is not in the acceptable list, skip it.         if ( ! in_array( $ext$editable_extensions, true ) ) {
            wp_die( sprintf( '<p>%s</p>', __( 'Files of this type are not editable.' ) ) );
        }
    }
return new WP_Error( 'nonce_failure' );
        }

        if ( ! array_key_exists( $pluginget_plugins() ) ) {
            return new WP_Error( 'invalid_plugin' );
        }

        if ( 0 !== validate_file( $fileget_plugin_files( $plugin ) ) ) {
            return new WP_Error( 'bad_plugin_file_path', __( 'Sorry, that file cannot be edited.' ) );
        }

        $editable_extensions = wp_get_plugin_file_editable_extensions( $plugin );

        $real_file = WP_PLUGIN_DIR . '/' . $file;

        $is_active = in_array(
            $plugin,
            (array) get_option( 'active_plugins', array() ),
            true
        );

    } elseif ( ! empty( $args['theme'] ) ) {
        $stylesheet = $args['theme'];

        
Home | Imprint | This part of the site doesn't use cookies.