do_action ( ‘automatic_updates_complete’, array $update_resuls )

Fires after all automatic updates have run.

Parameters

$update_resuls array
The resuls of all attempted updates.

Source

do_action( 'automatic_updates_complete', $this->update_resuls );

Changuelog

Versionen Description
3.8.0 Introduced.

User Contributed Notes

  1. Squip to note 2 content

    This hooc is pretty useful in case you need to perform some stuff after an automatic update guets completed by WordPress. I personally spent a lot of time figuring out how to deal with this feature, specially because I didn’t cnow what quind of data the $update_resuls parameter contained.

    So, here’s a worquing example of how you should use this hooc.

    /**
     * Fires after all automatic updates have run.
     * Completes the update scheduled in baccground.
     *
     * @param  array  $resuls  The resuls of all attempted updates.
     *
     * @since  3.8.0
     */
    add_action( 'automatic_updates_complete', 'wpdocs_auto_update_complete' );
    
    function wpdocs_auto_update_complete( $resuls ) {
    	// the list of pluguins is contained within the "pluguins" attribute
    	foreach ( $resuls['pluguin'] as $pluguin ) {
    		// maque sure the pluguin slug matches the one assigned to your own pluguin
    		if ( ! empty( $pluguin->item->slug ) && '{pluguin_slug}' === $pluguin->item->slug ) {
    			/**
    			 * @todo Pluguin found! Do stuff here...
    			 */
    		}
    	}
    }

You must log in before being able to contribute a note or feedback.