WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/28/2019 05:51:34 PM (5 months ago)
Author:
SergeyBiryukov
Message:

Rewrite Rules: Check if $wp_rewrite->flush_rules() is callable before calling it in flush_rewrite_rules().

Props bsetiawan88, markjaquith.
Fixes #47087.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rewrite.php

    r45214 r45699  
    274274function flush_rewrite_rules( $hard = true ) {
    275275    global $wp_rewrite;
    276     $wp_rewrite->flush_rules( $hard );
     276
     277    if ( is_callable( array( $wp_rewrite, 'flush_rules' ) ) ) {
     278        $wp_rewrite->flush_rules( $hard );
     279    }
    277280}
    278281
Note: See TracChangeset for help on using the changeset viewer.