Make WordPress Core

Opened 5 years ago

Closed 4 months ago

#43284 closed defect (bug) (invalid)

Drop-in: Disabling "wp_install_defaults" affect permalinks & "/login" redirect

Reported by: rajitrazaki's profile rajitrazaki Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.9.4
Component: Upgrade/Install Keywords: close
Focuses: Cc:

Description

I want to prevent default "Uncategorized" category, first post (Hello world!), first page, and default widgets.

I need to disable wp_install_defaults. So, I created Drop-in /wp-content/install.php which contains:

<?php
        function wp_install_defaults() {
        }
?>

Strangely it also disable default permalinks setting (it not select "Day and name" but "Plain" instead), even though permalinks is on different function wp_install_maybe_enable_pretty_permalinks.

It also not redirect /login/ to /wp-login.php.

Change History (3)

#1 @SergeyBiryukov
5 years ago

  • Component changed from General to Upgrade/Install

#2 in reply to: ↑ description @SergeyBiryukov
5 years ago

  • Keywords close added

Hi @rajitrazaki, welcome to WordPress Trac! Thanks for the report, sorry it took a while for someone to get back to you.

Strangely it also disable default permalinks setting (it not select "Day and name" but "Plain" instead), even though permalinks is on different function wp_install_maybe_enable_pretty_permalinks.

That's because wp_install_maybe_enable_pretty_permalinks() checks if the 'hello-world' post is available, and then submits a request to check if it could be loaded successfully. Otherwise, it assumes that the server does not support pretty permalinks.

I don't see a core issue here. If your server does support pretty permalinks, you can just set the desired structure manually in your wp_install_defaults() function:

update_option( 'permalink_structure', '/%year%/%monthnum%/%day%/%postname%/' );

It also not redirect /login/ to /wp-login.php.

This redirect depends on pretty permalinks being enabled.

#3 @hellofromTonya
4 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

I agree with @SergeyBiryukov that it does not appear to be a Core issue. @rajitrazaki did the help Sergey provided resolve the issue for you?

I'll close this ticket.

If the issue persists, the Support Forums are likely a great place to start in helping to diagnosis and hopefully resolve the issue.

Note: See TracTickets for help on using tickets.