WordPress.org

Make WordPress Core

Ticket #12670: 12670.001.diff

File 12670.001.diff, 2.2 KB (added by aaroncampbell, 4 years ago)
  • wp-admin/includes/file.php

     
    3434        'audio.php' => __('Audio Attachment Template'), 
    3535        'application.php' => __('Application Attachment Template'), 
    3636        'my-hacks.php' => __( 'my-hacks.php (legacy hacks support)' ), 
    37         '.htaccess' => __( '.htaccess (for rewrite rules )' ), 
     37        apply_filters( 'access_file_name', '.htaccess' ) => __( '.htaccess (for rewrite rules )' ), 
    3838        // Deprecated files 
    3939        'wp-layout.css' => __( 'Stylesheet' ), 'wp-comments.php' => __( 'Comments Template' ), 'wp-comments-popup.php' => __( 'Popup Comments Template' )); 
    4040 
     
    9292 * @return unknown 
    9393 */ 
    9494function get_real_file_to_edit( $file ) { 
    95         if ('index.php' == $file || '.htaccess' == $file ) { 
     95        if ('index.php' == $file || apply_filters( 'access_file_name', '.htaccess' ) == $file ) { 
    9696                $real_file = get_home_path() . $file; 
    9797        } else { 
    9898                $real_file = WP_CONTENT_DIR . $file; 
  • wp-admin/includes/misc.php

     
    126126        global $wp_rewrite; 
    127127 
    128128        $home_path = get_home_path(); 
    129         $htaccess_file = $home_path.'.htaccess'; 
     129        $htaccess_file = $home_path . apply_filters( 'access_file_name', '.htaccess' ); 
    130130 
    131131        // If the file doesn't already exist check for write access to the directory and whether we have some rules. 
    132132        // else check for write access to the file. 
  • wp-admin/options-permalink.php

     
    116116        else 
    117117                $writable = false; 
    118118} else { 
    119         if ( ( ! file_exists($home_path . '.htaccess') && is_writable($home_path) ) || is_writable($home_path . '.htaccess') ) 
     119        $htaccess_file = $home_path . apply_filters( 'access_file_name', '.htaccess' ); 
     120        if ( ( ! file_exists($htaccess_file) && is_writable($home_path) ) || is_writable($htaccess_file) ) 
    120121                $writable = true; 
    121122        else 
    122123                $writable = false;