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

Props bsetiawan88, markjaquith.
Fixes #47087.

git-svn-id: https://develop.svn.wordpress.org/trunk@45699 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2019-07-28 17:51:34 +00:00
parent aee18a2e09
commit da0f9cd6fb

View File

@ -273,7 +273,10 @@ function add_feed( $feedname, $function ) {
*/ */
function flush_rewrite_rules( $hard = true ) { function flush_rewrite_rules( $hard = true ) {
global $wp_rewrite; global $wp_rewrite;
$wp_rewrite->flush_rules( $hard );
if ( is_callable( array( $wp_rewrite, 'flush_rules' ) ) ) {
$wp_rewrite->flush_rules( $hard );
}
} }
/** /**