From da0f9cd6fbf1d8156e0f39837f7d381f46d9e942 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 28 Jul 2019 17:51:34 +0000 Subject: [PATCH] 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 --- src/wp-includes/rewrite.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/rewrite.php b/src/wp-includes/rewrite.php index a03754f272..2666ff6f97 100644 --- a/src/wp-includes/rewrite.php +++ b/src/wp-includes/rewrite.php @@ -273,7 +273,10 @@ function add_feed( $feedname, $function ) { */ function flush_rewrite_rules( $hard = true ) { global $wp_rewrite; - $wp_rewrite->flush_rules( $hard ); + + if ( is_callable( array( $wp_rewrite, 'flush_rules' ) ) ) { + $wp_rewrite->flush_rules( $hard ); + } } /**