$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>Upgrade wordpress core programmatically with PHP|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Upgrade wordpress core programmatically with PHP

matteradmin8PV0评论
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 12 years ago.

What I want to do

I want to upgrade Wordpress programmatically to a later version. That I want to do with PHP, lets say from /?upgrade_wp=true

I already know how to get the URL of the latest version so I don't having any problem with checking for versions or finding the right URL.

Answers I want

  • A link to a tutorial of how this is done.
  • A plugin that does this and not so much more.
  • A hint to the functions that I need to use.

Answers I don't want

  • The way to do it with SVN or subversion.
  • Answers containing Wordpress MU.
  • How to manually doing this.
  • How to do this with other code than PHP.
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 12 years ago.

What I want to do

I want to upgrade Wordpress programmatically to a later version. That I want to do with PHP, lets say from http://www.example/?upgrade_wp=true

I already know how to get the URL of the latest version so I don't having any problem with checking for versions or finding the right URL.

Answers I want

  • A link to a tutorial of how this is done.
  • A plugin that does this and not so much more.
  • A hint to the functions that I need to use.

Answers I don't want

  • The way to do it with SVN or subversion.
  • Answers containing Wordpress MU.
  • How to manually doing this.
  • How to do this with other code than PHP.
Share Improve this question edited Feb 9, 2019 at 0:03 fuxia 107k39 gold badges255 silver badges461 bronze badges asked Jun 10, 2012 at 19:34 Jens TörnellJens Törnell 4231 gold badge10 silver badges26 bronze badges 7
  • 3 Why would you want to install a plugin that does something WP already does out of the box? – moraleida Commented Jun 10, 2012 at 19:43
  • 2 Absent some example of a non-niche use case, Close-voted as too localized. – Chip Bennett Commented Jun 10, 2012 at 19:49
  • 5 Answers I want/don't want = invitation for being sarcastic, but I'll refrain myself & instead some useful info: study how InfiniteWP does it... – brasofilo Commented Jun 10, 2012 at 22:55
  • @brasofilo Thanks! InfiniteWP was just what I was going to build. Now I don't need to... – Jens Törnell Commented Jun 12, 2012 at 18:23
  • @ChipBennett How can update Wordpress from the outside be too localized? Many people have done that. Just not that many people show their code like InfiniteWP. – Jens Törnell Commented Jun 12, 2012 at 18:25
 |  Show 2 more comments

2 Answers 2

Reset to default 2

A hint to the functions that I need to use.

I'm not sure why you'll want to mimic WP's default behavior, but most of the update logic lies on wp-admin/update-core.php

Check for do_core_upgrade().

The trigger function for core update seems to be wp_update_core(), which calls Core_Upgrader class (source).

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far