Changeset 2176202
- Timestamp:
- 10/19/2019 08:39:28 PM (6 years ago)
- Location:
- wootomation/trunk
- Files:
-
- 3 edited
-
includes/class-admin.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
wootomation.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wootomation/trunk/includes/class-admin.php
r2176195 r2176202 63 63 64 64 public function wootomation_suggestions_per_page(){ 65 $option = esc_attr( get_ option('wootomation_suggestions_per_page') );65 $option = esc_attr( get_site_option('wootomation_suggestions_per_page') ); 66 66 echo '<input type="number" name="wootomation_suggestions_per_page" value="'.$option.'" placeholder="3" />'; 67 67 } 68 68 69 69 public function wootomation_after_cart_table(){ 70 $option = esc_attr( get_ option('wootomation_after_cart_table') );70 $option = esc_attr( get_site_option('wootomation_after_cart_table') ); 71 71 $html = '<label class="switch">'; 72 72 $html .= '<input type="checkbox" name="wootomation_after_cart_table" value="1"' . checked( 1, $option, false ) . '/>'; … … 77 77 78 78 public function wootomation_after_cart_table_title(){ 79 $option = esc_attr( get_ option('wootomation_after_cart_table_title') );79 $option = esc_attr( get_site_option('wootomation_after_cart_table_title') ); 80 80 echo '<input type="text" name="wootomation_after_cart_table_title" value="'.$option.'" placeholder="People who bought this, also bought…" class="regular-text" />'; 81 81 } -
wootomation/trunk/readme.txt
r2176195 r2176202 39 39 == Changelog == 40 40 41 = 1.1.1 = 42 * Added multisite support. 43 41 44 = 1.1.0 = 42 45 * Added settings page. … … 52 55 == Upgrade Notice == 53 56 57 = 1.1.1 = 58 Added multisite support. 59 54 60 = 1.1.0 = 55 61 Upgrade now to take advantage of the new settings page! Also fixed a bug for new stores. -
wootomation/trunk/wootomation.php
r2176200 r2176202 4 4 * Plugin URI: https://wordpress.org/support/plugin/wootomation/ 5 5 * Description: 🤖 Increase the sales of your WooCommerce shop by suggesting the right products to your customers, with the help of Machine Learning Artificial Intelligence. To take advantage of its power, just install and activate, it works out of the box. 6 * Version: 1.1. 07 * Stable tag: 1.1. 06 * Version: 1.1.1 7 * Stable tag: 1.1.1 8 8 * Author: Dragos Micu 9 9 * Author URI: https://wordpress.org/support/users/dragosmicu/ … … 32 32 $this->plugin_name = plugin_basename( __FILE__ ); 33 33 $this->ajax_url = admin_url('admin-ajax.php'); 34 $this->suggestions_per_page = get_ option('wootomation_suggestions_per_page') ? get_option('wootomation_suggestions_per_page') : 3;35 $this->location = esc_attr( get_ option('wootomation_after_cart_table') );34 $this->suggestions_per_page = get_site_option('wootomation_suggestions_per_page') ? get_site_option('wootomation_suggestions_per_page') : 3; 35 $this->location = esc_attr( get_site_option('wootomation_after_cart_table') ); 36 36 $this->titles = apply_filters( 'wootomation_titles', array( 37 'wootomation_after_cart_table_title' => get_ option('wootomation_after_cart_table_title') ? get_option('wootomation_after_cart_table_title') : "People who bought this, also bought…",37 'wootomation_after_cart_table_title' => get_site_option('wootomation_after_cart_table_title') ? get_site_option('wootomation_after_cart_table_title') : "People who bought this, also bought…", 38 38 )); 39 39 … … 81 81 public function deactivate() { 82 82 flush_rewrite_rules(); 83 delete_site_option( 'wt-donate' ); 84 delete_site_option( 'wt-hide-review' ); 83 85 } 84 86 … … 88 90 public function wt_admin_notices() { 89 91 // Adds notice of require WooCommerce plugin 90 if( !in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_ option( 'active_plugins' ) ) ) || !class_exists('WooCommerce') ){92 if( !in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_site_option( 'active_plugins' ) ) ) || !class_exists('WooCommerce') ){ 91 93 ?> 92 94 <div class="notice-warning settings-error notice"> … … 96 98 } 97 99 // Check and display on install notices 98 if( get_ transient( 'wt-admin-notices-on-install' ) ){100 if( get_site_transient( 'wt-admin-notices-on-install' ) ){ 99 101 ?> 100 102 <div class="updated woocommerce-message woocommerce-admin-promo-messages is-dismissible"> … … 104 106 <?php 105 107 /* Delete transient, only display this notice once. */ 106 delete_ transient( 'wt-admin-notices-on-install' );108 delete_site_transient( 'wt-admin-notices-on-install' ); 107 109 } 108 110 // Check and display after one month notices 109 if( !get_ transient( 'wt-admin-notices-after-one-month' ) ){111 if( !get_site_transient( 'wt-admin-notices-after-one-month' ) ){ 110 112 // check if wt-hide-review option doesn't exist 111 if( false === get_ option('wt-hide-review' ) ) {113 if( false === get_site_option('wt-hide-review' ) ) { 112 114 // then check for "Dismiss" GET request 113 115 if( isset( $_GET['wt-hide-review'] ) ): 114 116 // If GET request to hide notice exists, add option 115 117 if( $_GET['wt-hide-review'] === 'true' ): 116 add_ option('wt-hide-review', 'true');118 add_site_option('wt-hide-review', 'true'); 117 119 endif; 118 120 // If GET request doesn't exist, continue displaying notice … … 126 128 } 127 129 // Check and display after two months notices 128 if( !get_ transient( 'wt-admin-notices-after-two-months' ) ){130 if( !get_site_transient( 'wt-admin-notices-after-two-months' ) ){ 129 131 // check if wt-donate option doesn't exist 130 if( false === get_ option('wt-donate' ) ) {132 if( false === get_site_option( 'wt-donate' ) ) { 131 133 // then check for "Dismiss" GET request 132 134 if( isset( $_GET['wt-donate'] ) ): 133 135 // If GET request to hide notice exists, add option 134 136 if( $_GET['wt-donate'] === 'true' ): 135 add_ option('wt-donate', 'true');137 add_site_option('wt-donate', 'true'); 136 138 endif; 137 139 // If GET request doesn't exist, continue displaying notice … … 200 202 */ 201 203 public function ai_suggestions_display(){ 202 $associator = get_ option( 'wootomation-associator' );204 $associator = get_site_option( 'wootomation-associator' ); 203 205 204 206 if( !$associator ) return false;
Note: See TracChangeset
for help on using the changeset viewer.