Alternative of register_activation_hook
-
I can see the
register_activation_hook
is using theplugin_basename
from the source:
https://developer.www.ads-software.com/reference/functions/register_activation_hook/#sourceCan I just use:
add_action( 'activate_' . basename(__DIR__) . '/' . basename(__FILE__), 'my_callback_function' );
Why? Because
. basename(__DIR__) . '/' . basename(__FILE__)
is a lot more shorter than theplugin_basename
( https://developer.www.ads-software.com/reference/functions/plugin_basename/#source )
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Alternative of register_activation_hook’ is closed to new replies.