From c7493264a41addda75c05e49d65e8cc2bbbeaf44 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 28 Jul 2019 17:52:56 +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. Built from https://develop.svn.wordpress.org/trunk@45699 git-svn-id: http://core.svn.wordpress.org/trunk@45510 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/rewrite.php | 5 ++++- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index a03754f272..2666ff6f97 100644 --- a/wp-includes/rewrite.php +++ b/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 ); + } } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 3d09776eb0..acabe2ec7d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-45698'; +$wp_version = '5.3-alpha-45699'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.