assets
1 year ago
dist
1 year ago
includes
1 year ago
languages
1 year ago
lib
4 years ago
templates
1 year ago
init.php
1 year ago
license.txt
2 years ago
phpcs.xml
3 years ago
yit-deactive-plugin.php
3 years ago
yit-functions.php
1 year ago
yit-plugin-registration-hook.php
5 years ago
yit-plugin.php
1 year ago
yit-woocommerce-compatibility.php
2 years ago
yit-plugin-registration-hook.php
24 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Functions for plugin registration hook. |
| 4 | * |
| 5 | * @package YITH\PluginFramework |
| 6 | */ |
| 7 | |
| 8 | defined( 'ABSPATH' ) || exit; // Exit if accessed directly. |
| 9 | |
| 10 | if ( ! function_exists( 'yith_plugin_registration_hook' ) ) { |
| 11 | /** |
| 12 | * Register the plugin when activated. |
| 13 | * Please note: use this function through register_activation_hook. |
| 14 | * |
| 15 | * @use activate_PLUGINNAME hook |
| 16 | */ |
| 17 | function yith_plugin_registration_hook() { |
| 18 | $hook = str_replace( 'activate_', '', current_filter() ); |
| 19 | $option = get_option( 'yit_recently_activated', array() ); |
| 20 | $option[] = $hook; |
| 21 | update_option( 'yit_recently_activated', $option ); |
| 22 | } |
| 23 | } |
| 24 |