👁 查看:yit-plugin-registration-hook.php
路径:/home/forge/yith-woocommerce-compare/plugin-fw/yit-plugin-registration-hook.php
大小:625 B · 修改:2023-08-03 14:10:49 · 权限:0644 · 可写
<?php
/**
 * Functions for plugin registration hook.
 *
 * @package YITH\PluginFramework
 */

defined( 'ABSPATH' ) || exit; // Exit if accessed directly.

if ( ! function_exists( 'yith_plugin_registration_hook' ) ) {
	/**
	 * Register the plugin when activated.
	 * Please note: use this function through register_activation_hook.
	 *
	 * @use activate_PLUGINNAME hook
	 */
	function yith_plugin_registration_hook() {
		$hook     = str_replace( 'activate_', '', current_filter() );
		$option   = get_option( 'yit_recently_activated', array() );
		$option[] = $hook;
		update_option( 'yit_recently_activated', $option );
	}
}