Plugins Handbook Functions Q |


I’m reading the WP Plugins Handbook, starts w register_activation_hook and register_deactivation_hook, but i’ve noticed not all plugins use these.

Why do some plugins (Lightweight Social Icons by GeneratePress) only use ‘plugins_loaded’ hook and neither of the register hooks above and under what conditions would I use one or the other or both?

I’m guessing the social icon plugin doesn’t need additional functionality that comes with the register hooks. Whereas, a more complicated plugin, like CoBlocks by GoDaddy needs the added functionality.

 Am i on the right track by surmising that if a plugin provides CPT functionality, for example, it would require using the activation hooks to assist w the rewrite rules, etc.?
Thank you!!

  • This topic was modified 1 day, 16 hours ago by Jan Dembowski. Reason: Moved to Everything else WordPress, this is not an Developing with WordPress topic

Source link