edd_after_install

Post-installation.

Description

edd_after_install(); 

Runs just after plugin installation and exposes the edd_after_install hook.


Usage

  1. if ( !function_exists( 'edd_after_install' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'easy-digital-downloads/includes/install.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = edd_after_install(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/install.php  
  1. function edd_after_install() { 
  2.  
  3. if ( ! is_admin() ) { 
  4. return; 
  5.  
  6. $edd_options = get_transient( '_edd_installed' ); 
  7. $edd_table_check = get_option( '_edd_table_check', false ); 
  8.  
  9. if ( false === $edd_table_check || current_time( 'timestamp' ) > $edd_table_check ) { 
  10.  
  11. if ( ! @EDD()->customer_meta->installed() ) { 
  12.  
  13. // Create the customer meta database (this ensures it creates it on multisite instances where it is network activated) 
  14. @EDD()->customer_meta->create_table(); 
  15.  
  16.  
  17. if ( ! @EDD()->customers->installed() ) { 
  18. // Create the customers database (this ensures it creates it on multisite instances where it is network activated) 
  19. @EDD()->customers->create_table(); 
  20. @EDD()->customer_meta->create_table(); 
  21.  
  22. do_action( 'edd_after_install', $edd_options ); 
  23.  
  24. update_option( '_edd_table_check', ( current_time( 'timestamp' ) + WEEK_IN_SECONDS ) ); 
  25.  
  26.  
  27. if ( false !== $edd_options ) { 
  28. // Delete the transient 
  29. delete_transient( '_edd_installed' ); 
  30.  
  31.