Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_action('after_setup_theme', 'mytheme_init');
- function mytheme_init() {
- // Check if already saved the activation date & time
- // to prevent over-writing if user deactive & active theme
- // multiple time
- if(!get_option('mytheme_activation_time', false)){
- // Generate Current Date & Time in MySQL Date Time Formate
- $activation_datetime = current_time( 'mysql' );
- // Save it in `wp_options` table
- add_option('mytheme_activation_time', $activation_datetime);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement