Hot answers tagged

4

Skimming through the Core_Upgrader::should_update_to_version() method, it looks like we can override the defined( 'WP_AUTO_UPDATE_CORE' ) // true (all), false, minor check, used to setup the local boolean variables$upgrade_dev, $upgrade_minor and $upgrade_major, with the following filters: ... apply_filters( 'allow_dev_auto_core_updates', ...


3

First things first, avoid defining functions inside functions. PHP doesn't have a problem with it, but it's usually a sign you're "doing it wrong" and it just leads to unnecessary headaches. Second, your foreach loop at the bottom is a little malformed. You need to define the <ul> outside the loop, and then append to $html - otherwise you just end up ...


3

As so often, WP-CLI already has you covered: wp core update --version=3.8 ../latest.zip Have a look here for more details: http://wp-cli.org/commands/core/update/


2

So are you going to automate your backup as well to be triggered before the DB upgrade starts? While the question has merit especially in a multisite context (in which the scenario is a little different) I am not sure that it is smart thing to do. That message could have said "this is your last chance to perform a backup of the DB, click the button only ...


1

Not sure if I understand your question, but I think installing the debug bar with the hooks and filters plugin could help you. Debugbar Actions and filters addon


1

has_filter() checks if any filter has been registered for a hook. This is what I want really


1

The point of hardening is to avoid the core files to be manipulated by external users (on shared hosting) and by the webserver (as it is the main source of exploits). Since the update runs via the webserver it is obvious that if you hardened your files against webserver initiated manipulation, the update will fail. Most people probably get around it by ...


1

you should be able to use this hook which fires just before an auto update: do_action( 'pre_auto_update', $type, $item, $context ); $type can be 'core', 'theme', 'plugin', 'translation' a specific solution would depend on your particular backup plugin/service, but as long as this plugin/service provides either suitable hooks or an API it should be doable ...


1

I think I found the solution: add_filter('wp_insert_post_data','reset_post_date',99,2); function reset_post_date($data,$postarr) { //update post time on status change $data['post_date'] = $data['post_modified']; $data['post_date_gmt'] = $data['post_modified_gmt']; //also update title and add the current date to title ...


1

Take a look at the AJAX documentation, there are plenty of examples on this site and across the Googles to trigger a server event without refreshing the page. In this case, WP is listening to an AJAX call that looks like http://example.com/wp-admin/admin-ajax.php?action=wpse20160318_batch_update. When triggered, it'll run through your batch process an ...


1

This one is actually surprisingly simple; add this to your wp-config.php file and all automatic updates will be blocked when outside of the specified hours: // Suspend updates when outside of business hours, 9:00 AM to 5:30 PM $updates_suspended = (date('Hi') < 0900 || date('Hi') > 1730); define( 'AUTOMATIC_UPDATER_DISABLED', $updates_suspended ); ...


1

If you get that Database update message, looks like WordPress may have updated. Probably you want to turn automatic updates off. Simply do: 1 - Restore your db where it works ok 2 - Add this to your wp-config.php: define( 'AUTOMATIC_UPDATER_DISABLED', true ); 3 - Enjoy!


1

I often do Manual Update, it's not that pain. :) Just do it in this way (I hope you know how to update manually): Step 1: Remove wp-includes, and wp-admin from Server and Upload new two Step 2: Cut/Copy all the loose files from local folder and Paste them to the server root with Overwrite permission - Just a replace And you are done. :) Optional Step 1: ...



Only top voted, non community-wiki answers of a minimum length are eligible