• Resolved luigitec

    (@luigitec)


    Hello guys,

    I wish you could direct me on the right direction:

    – Working a WordPress MU Installation
    – I create the sites via a custom REST API endpoint which runs several things
    – When I create a new site, I get the warning message “Please complete your Redirection setup to activate the plugin”

    I’m trying to run such setup via the REST API endpoint as a callback with the following methods:

    WP_CLI::runcommand('redirection database install'); //and the url as a parameter
    WP_CLI::runcommand('redirection database upgrade'); //and the url as a parameter
    WP_CLI::runcommand('redirection setting monitor_post 1'); //and the url as a parameter
    

    But for some reason, it’s not working, I tried the same WP-CLI commands to make sure they work, and noticed that it ignores the --url= parameter and updates all the sites on the MU network:

    wp redirection database install --url=https://testdomain.dev

    The above returns:

    
    Success: Site 1 database is installed
    Success: Site 64 database is installed
    Success: Site 65 database is installed
    Success: Site 66 database is installed
    Success: Site 67 database is installed
    Success: ...
    

    As you can see, it ran across all the blogs on the installation, not just the one on the --url parameter.

    Also, I’m trying to enable the Monitor for post slug chances, I ran:
    wp redirection setting monitor_post 1 --url=https://testdomain.dev or
    wp redirection setting monitor_post true --url=https://testdomain.dev

    But none of the above worked, just without the --url parameter it returned the expected Success: 1

    • This topic was modified 3 years, 4 months ago by luigitec.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Upgrade database programmatically on installation’ is closed to new replies.