Make WordPress Core

Ticket #44171: 44171.diff

File 44171.diff, 479 bytes (added by kraftbj, 7 years ago)

Props azaozz for the code, kraftbj for the location. Carried over from #44142.

  • src/wp-includes/rewrite.php

     
    273273 */
    274274function flush_rewrite_rules( $hard = true ) {
    275275        global $wp_rewrite;
     276
     277        if ( ! is_admin() ) {
     278                _doing_it_wrong( __FUNCTION__, __( 'Rewrite rules should only be updated in wp-admin context.' ), '5.0' );
     279        }
     280
    276281        $wp_rewrite->flush_rules( $hard );
    277282}
    278283