woocp_install

Install Database, settings option and auto add widget to sidebar.

Description

woocp_install(); 

Usage

  1. if ( !function_exists( 'woocp_install' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-compare-products-lite/admin/compare_init.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = woocp_install(); 
  7.  

Defined (1)

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

/admin/compare_init.php  
  1. function woocp_install() { 
  2.  
  3. // Upgrade database for site have used Lite is less than 2.2.0 
  4. if ( get_option( 'a3rev_woocp_lite_version', false ) != false 
  5. && version_compare(get_option('a3rev_woocp_lite_version'), '2.1.9.3') === -1 ) { 
  6.  
  7. include( WOOCP_DIR. '/includes/updates/compare-update-2.1.9.3.php' ); 
  8.  
  9. update_option('a3rev_woocp_pro_version', '2.4.5'); 
  10. update_option('a3rev_woocp_lite_version', '2.5.4'); 
  11. $product_compare_id = WC_Compare_Functions::create_page( esc_sql( 'product-comparison' ), '', __('Product Comparison', 'woocommerce-compare-products' ), '[product_comparison_page]' ); 
  12. update_option('product_compare_id', $product_compare_id); 
  13.  
  14. WC_Compare_Data::install_database(); 
  15. WC_Compare_Categories_Data::install_database(); 
  16. WC_Compare_Categories_Fields_Data::install_database(); 
  17.  
  18. global $wc_compare_admin_init; 
  19. delete_metadata( 'user', 0, $wc_compare_admin_init->plugin_name . '-' . 'plugin_framework_global_box' . '-' . 'opened', '', true ); 
  20.  
  21.  
  22. update_option('a3rev_woocp_just_installed', true);