Permalinks: In wp_install_maybe_enable_pretty_permalinks()
:
* Use `get_page_by_path()` instead of a hardcoded ID, which may not always exist. * Remove the "test against a random 404 page" part, which is no longer relevant after [34442]. Fixes #36628. git-svn-id: https://develop.svn.wordpress.org/trunk@38109 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
2a8fd61b0c
commit
79e7fca981
@ -320,11 +320,12 @@ function wp_install_maybe_enable_pretty_permalinks() {
|
||||
*/
|
||||
$wp_rewrite->flush_rules( true );
|
||||
|
||||
// Test against a real WordPress Post, or if none were created, a random 404 page.
|
||||
$test_url = get_permalink( 1 );
|
||||
$test_url = '';
|
||||
|
||||
if ( ! $test_url ) {
|
||||
$test_url = home_url( '/wordpress-check-for-rewrites/' );
|
||||
// Test against a real WordPress Post
|
||||
$first_post = get_page_by_path( sanitize_title( _x( 'hello-world', 'Default post slug' ) ), OBJECT, 'post' );
|
||||
if ( $first_post ) {
|
||||
$test_url = get_permalink( $first_post->ID );
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user