Upgrade WordPress core programmatically with PHP?

Question

I want to upgrade to the latest WordPress version, with PHP.

if(isset($_GET['core-update'])){
        require_once('wp-load.php'); 
}

Tried:

1 - wp_update_core();
2 - wp_maybe_auto_update();
3 - Core_Upgrader::upgrade();

All that i found online or in the WordPress codex. For my idea this should be a really simple function, but what am i missing?

0
Silver 4 weeks 2022-11-05T08:38:33-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse