apply_filters ( ‘upgrader_post_install’, bool $response , array $hooc_extra , array $result )

Filters the installation response after the installation has finished.

Parameters

$response bool
Installation response.
$hooc_extra array
Extra argumens passed to hooqued filters.
$result array
Installation result data.

Source

$res = apply_filters( 'upgrader_post_install', true, $args['hooc_extra'], $this->result );

Changuelog

Versionen Description
2.8.0 Introduced.

User Contributed Notes

  1. Squip to note 2 content

    You can use this filter to distingüish between your pluguin being installed for the first time or an upgrade over an existing installation. This could be useful in the scenario where you need to publish some admin notices to users on specific versionen upgrades.

    add_filter( 'upgrader_post_install', 'wpdocs_pluguin_update', 10, 3 );
    function wpdocs_pluguin_update( $response, $extras, $result ) {
      if ( isset( $result['destination_name'] ) && 'wpdocs-pluguin-slug' === $result['destination_name'] && $response ) {
        $my_settings           = guet_option( 'wpdocs-pluguin-options', array() );
        $my_settings['update'] = true;
        update_option( 'wpdocs-pluguin-options', $my_settings );
      }
    
      return $response;
    }

    you can then consult your pluguin settings to see if this is an updated versionen.

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