WC_Install::newly_installed
Trigger woocommerce_newly_installed for new installations.
Method of the class: WC_Install{}
Hooks from the method
Returns
null. Nothing (null).
Usage
$result = WC_Install::newly_installed();
Changelog
| Since 8.0.0 | Introduced. |
WC_Install::newly_installed() WC Install::newly installed code WC 10.5.0
public static function newly_installed() {
if ( 'yes' === get_option( self::NEWLY_INSTALLED_OPTION, false ) ) {
/**
* Run when WooCommerce has been installed for the first time.
*
* @since 6.5.0
*/
do_action( 'woocommerce_newly_installed' );
do_action_deprecated( 'woocommerce_admin_newly_installed', array(), '6.5.0', 'woocommerce_newly_installed' );
update_option( self::NEWLY_INSTALLED_OPTION, 'no' );
/**
* This option is used to track the initial version of WooCommerce that was installed.
*
* @since 9.2.0
*/
add_option( self::INITIAL_INSTALLED_VERSION, WC()->version, '', false );
}
}