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
This commit is contained in:
Sergey Biryukov 2019-07-28 17:52:56 +00:00
parent 98642b4821
commit c7493264a4
2 changed files with 5 additions and 2 deletions

View File

@ -273,8 +273,11 @@ function add_feed( $feedname, $function ) {
*/
function flush_rewrite_rules( $hard = true ) {
global $wp_rewrite;
if ( is_callable( array( $wp_rewrite, 'flush_rules' ) ) ) {
$wp_rewrite->flush_rules( $hard );
}
}
/**
* Add an endpoint, like /trackback/.

View File

@ -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.