File size: 515 Bytes
572ed8c
 
 
 
 
 
 
 
 
c952552
 
0242427
c952552
0242427
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
/**
 * Plugin Name: OptiMix Permalinks Fix
 * Description: Forces clean permalinks by overriding rewrite checks.
 */

// Force WordPress to believe mod_rewrite is enabled
add_filter('got_rewrite', '__return_true', 999);

// Force the permalink structure without writing to the DB
add_filter('pre_option_permalink_structure', function($structure) {
    return '/%postname%/';
});

// Flush rewrite rules to ensure the new structure is active
add_action('init', function() {
    flush_rewrite_rules();
}, 999);