WordPress.org

Make WordPress Core

Ticket #21020: 21020.hotfix.diff

File 21020.hotfix.diff, 877 bytes (added by duck_, 6 years ago)
  • hotfix.php

     
    3434        $hotfixes = array();
    3535
    3636        switch ( $wp_version ) {
     37                case '3.4' :
     38                        $hotfixes = array( '340_walk_dirs_for_post_rewrites' );
     39                        break;
    3740                case '3.3' :
    3841                        $hotfixes = array( '330_no_wp_print_styles_in_admin', '330_no_json_encode_load_scripts' );
    3942                        break;
     
    132135        if ( ! defined( 'CONCATENATE_SCRIPTS' ) )
    133136                define( 'CONCATENATE_SCRIPTS', false );
    134137}
     138
     139function wp_hotfix_340_walk_dirs_for_post_rewrites() {
     140        add_filter( 'post_rewrite_rules', 'wp_hotfix_340_generate_post_rewrite_rules' );
     141}
     142
     143function wp_hotfix_340_generate_post_rewrite_rules( $rules ) {
     144        global $wp_rewrite;
     145        return $wp_rewrite->generate_rewrite_rules( $wp_rewrite->permalink_structure, EP_PERMALINK, false );
     146}