Changeset 2061774
- Timestamp:
- 04/02/2019 06:46:52 PM (7 years ago)
- Location:
- wc-checkout-terms-popup
- Files:
-
- 4 added
- 4 edited
- 1 copied
-
tags/1.0.1 (copied) (copied from wc-checkout-terms-popup/trunk)
-
tags/1.0.1/changelog.txt (added)
-
tags/1.0.1/license.txt (added)
-
tags/1.0.1/readme.txt (modified) (2 diffs)
-
tags/1.0.1/wc-checkout-terms-popup.php (modified) (2 diffs)
-
trunk/changelog.txt (added)
-
trunk/license.txt (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wc-checkout-terms-popup.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wc-checkout-terms-popup/tags/1.0.1/readme.txt
r1543372 r2061774 4 4 Tags: woocommerce, modal, thickbox, popup, terms, conditions, terms & conditions 5 5 Requires at least: 4.0 6 Tested up to: 4.76 Tested up to: 5.1 7 7 Stable tag: 1.0.0 8 8 License: GPLv3 or later … … 84 84 == Changelog == 85 85 86 = 1.0.1 - 30/11/2016 = 87 * WP Tested upto 5.1 :) 88 86 89 = 1.0.0 - 30/11/2016 = 87 90 * Stable Initial Release. -
wc-checkout-terms-popup/tags/1.0.1/wc-checkout-terms-popup.php
r1543372 r2061774 4 4 * Plugin URI: http://github.com/shivapoudel/wc-checkout-terms-popup 5 5 * Description: WooCommerce extension to allow your Terms page to open in a popup window during the checkout process. 6 * Version: 1.0. 06 * Version: 1.0.1 7 7 * Author: Shiva Poudel 8 8 * Author URI: http://shivapoudel.com … … 18 18 if ( ! class_exists( 'WC_Checkout_Terms_Popup' ) ) : 19 19 20 /**21 * WC_Checkout_Terms_Popup class.22 */23 class WC_Checkout_Terms_Popup {20 /** 21 * WC_Checkout_Terms_Popup class. 22 */ 23 class WC_Checkout_Terms_Popup { 24 24 25 /** 26 * Plugin version. 27 * @var string 28 */ 29 const VERSION = '1.0.0'; 25 /** 26 * Plugin version. 27 * 28 * @var string 29 */ 30 const VERSION = '1.0.0'; 30 31 31 /** 32 * Instance of this class. 33 * @var object 34 */ 35 protected static $instance = null; 32 /** 33 * Instance of this class. 34 * 35 * @var object 36 */ 37 protected static $instance = null; 36 38 37 /**38 * Initialize the plugin.39 */40 private function __construct() {41 // Load plugin text domain.42 add_action( 'init', array( $this, 'load_plugin_textdomain' ) );39 /** 40 * Initialize the plugin. 41 */ 42 private function __construct() { 43 // Load plugin text domain. 44 add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); 43 45 44 // Checks with WooCommerce is installed.45 if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '2.3', '>=' ) ) {46 $this->includes();46 // Checks with WooCommerce is installed. 47 if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '2.3', '>=' ) ) { 48 $this->includes(); 47 49 48 // Hooks. 49 add_action( 'wp_footer', array( $this, 'load_terms_popup_template' ) ); 50 add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'plugin_action_links' ) ); 51 } else { 52 add_action( 'admin_notices', array( $this, 'woocommerce_missing_notice' ) ); 50 // Hooks. 51 add_action( 'wp_footer', array( $this, 'load_terms_popup_template' ) ); 52 add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'plugin_action_links' ) ); 53 } else { 54 add_action( 'admin_notices', array( $this, 'woocommerce_missing_notice' ) ); 55 } 56 } 57 58 /** 59 * Return an instance of this class. 60 * 61 * @return object A single instance of this class. 62 */ 63 public static function get_instance() { 64 // If the single instance hasn't been set, set it now. 65 if ( is_null( self::$instance ) ) { 66 self::$instance = new self(); 67 } 68 return self::$instance; 69 } 70 71 /** 72 * Load Localisation files. 73 * 74 * Note: the first-loaded translation file overrides any following ones if the same translation is present. 75 * 76 * Locales found in: 77 * - WP_LANG_DIR/wc-checkout-terms-popup/wc-checkout-terms-popup-LOCALE.mo 78 * - WP_LANG_DIR/plugins/wc-checkout-terms-popup-LOCALE.mo 79 */ 80 public function load_plugin_textdomain() { 81 $locale = apply_filters( 'plugin_locale', get_locale(), 'wc-checkout-terms-popup' ); 82 83 load_textdomain( 'wc-checkout-terms-popup', WP_LANG_DIR . '/wc-checkout-terms-popup/wc-checkout-terms-popup-' . $locale . '.mo' ); 84 load_plugin_textdomain( 'wc-checkout-terms-popup', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' ); 85 } 86 87 /** 88 * Get the plugin url. 89 * 90 * @return string 91 */ 92 public static function plugin_url() { 93 return untrailingslashit( plugins_url( '/', __FILE__ ) ); 94 } 95 96 /** 97 * Get the plugin path. 98 * 99 * @return string 100 */ 101 public static function plugin_path() { 102 return untrailingslashit( plugin_dir_path( __FILE__ ) ); 103 } 104 105 /** 106 * Includes. 107 */ 108 private function includes() { 109 include_once dirname( __FILE__ ) . '/includes/class-wc-checkout-terms-popup-scripts.php'; 110 include_once dirname( __FILE__ ) . '/includes/class-wc-checkout-terms-popup-settings.php'; 111 } 112 113 /** 114 * Load terms popup template. 115 */ 116 public function load_terms_popup_template() { 117 $terms_page = get_post( wc_get_page_id( 'terms' ) ); 118 $terms_button = get_option( 'woocommerce_terms_popup_footer_button' ); 119 $terms_scroll = get_option( 'woocommerce_terms_popup_force_scroll_end' ); 120 121 // Make sure WC terms page exists. 122 if ( wc_get_page_id( 'terms' ) > 0 && apply_filters( 'woocommerce_checkout_show_terms', true ) ) { 123 $class_list = array( 'wc-checkout-terms-popup' ); 124 125 // Thickbox class list. 126 if ( 'yes' == $terms_button ) { 127 $class_list[] = 'wc-enabled-terms-button'; 128 129 if ( 'yes' == $terms_scroll ) { 130 $class_list[] = 'wc-enabled-terms-scroll'; 131 } 132 } 133 134 // Load WC checkout terms popup template. 135 wc_get_template( 136 'checkout/terms-popup.php', 137 array( 138 'id' => 'wc-terms-and-conditions-popup', 139 'title' => $terms_page->post_title, 140 'content' => $terms_page->post_content, 141 'class_list' => $class_list, 142 'terms_button' => $terms_button, 143 'terms_scroll' => $terms_scroll, 144 ), 145 '', 146 self::plugin_path() . '/templates/' 147 ); 148 } 149 } 150 151 /** 152 * Display action links in the Plugins list table. 153 * 154 * @param array $actions 155 * @return array 156 */ 157 public function plugin_action_links( $actions ) { 158 $new_actions = array( 159 'settings' => '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=checkout' ) . '" title="' . esc_attr( __( 'View settings', 'wc-checkout-terms-popup' ) ) . '">' . __( 'Settings', 'wc-checkout-terms-popup' ) . '</a>', 160 ); 161 162 return array_merge( $new_actions, $actions ); 163 } 164 165 /** 166 * WooCommerce fallback notice. 167 * 168 * @return string 169 */ 170 public function woocommerce_missing_notice() { 171 echo '<div class="error notice is-dismissible"><p>' . sprintf( __( 'WooCommerce Terms & Conditions Popup depends on the last version of %s or later to work!', 'wc-checkout-terms-popup' ), '<a href="http://www.woothemes.com/woocommerce/" target="_blank">' . __( 'WooCommerce 2.3', 'wc-checkout-terms-popup' ) . '</a>' ) . '</p></div>'; 53 172 } 54 173 } 55 174 56 /** 57 * Return an instance of this class. 58 * @return object A single instance of this class. 59 */ 60 public static function get_instance() { 61 // If the single instance hasn't been set, set it now. 62 if ( is_null( self::$instance ) ) { 63 self::$instance = new self(); 64 } 65 return self::$instance; 66 } 67 68 /** 69 * Load Localisation files. 70 * 71 * Note: the first-loaded translation file overrides any following ones if the same translation is present. 72 * 73 * Locales found in: 74 * - WP_LANG_DIR/wc-checkout-terms-popup/wc-checkout-terms-popup-LOCALE.mo 75 * - WP_LANG_DIR/plugins/wc-checkout-terms-popup-LOCALE.mo 76 */ 77 public function load_plugin_textdomain() { 78 $locale = apply_filters( 'plugin_locale', get_locale(), 'wc-checkout-terms-popup' ); 79 80 load_textdomain( 'wc-checkout-terms-popup', WP_LANG_DIR . '/wc-checkout-terms-popup/wc-checkout-terms-popup-' . $locale . '.mo' ); 81 load_plugin_textdomain( 'wc-checkout-terms-popup', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' ); 82 } 83 84 /** 85 * Get the plugin url. 86 * @return string 87 */ 88 public static function plugin_url() { 89 return untrailingslashit( plugins_url( '/', __FILE__ ) ); 90 } 91 92 /** 93 * Get the plugin path. 94 * @return string 95 */ 96 public static function plugin_path() { 97 return untrailingslashit( plugin_dir_path( __FILE__ ) ); 98 } 99 100 /** 101 * Includes. 102 */ 103 private function includes() { 104 include_once( dirname( __FILE__ ) . '/includes/class-wc-checkout-terms-popup-scripts.php' ); 105 include_once( dirname( __FILE__ ) . '/includes/class-wc-checkout-terms-popup-settings.php' ); 106 } 107 108 /** 109 * Load terms popup template. 110 */ 111 public function load_terms_popup_template() { 112 $terms_page = get_post( wc_get_page_id( 'terms' ) ); 113 $terms_button = get_option( 'woocommerce_terms_popup_footer_button' ); 114 $terms_scroll = get_option( 'woocommerce_terms_popup_force_scroll_end' ); 115 116 // Make sure WC terms page exists. 117 if ( wc_get_page_id( 'terms' ) > 0 && apply_filters( 'woocommerce_checkout_show_terms', true ) ) { 118 $class_list = array( 'wc-checkout-terms-popup' ); 119 120 // Thickbox class list. 121 if ( 'yes' == $terms_button ) { 122 $class_list[] = 'wc-enabled-terms-button'; 123 124 if ( 'yes' == $terms_scroll ) { 125 $class_list[] = 'wc-enabled-terms-scroll'; 126 } 127 } 128 129 // Load WC checkout terms popup template. 130 wc_get_template( 'checkout/terms-popup.php', array( 'id' => 'wc-terms-and-conditions-popup', 'title' => $terms_page->post_title, 'content' => $terms_page->post_content, 'class_list' => $class_list, 'terms_button' => $terms_button, 'terms_scroll' => $terms_scroll ), '', self::plugin_path() . '/templates/' ); 131 } 132 } 133 134 /** 135 * Display action links in the Plugins list table. 136 * @param array $actions 137 * @return array 138 */ 139 public function plugin_action_links( $actions ) { 140 $new_actions = array( 141 'settings' => '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=checkout' ) . '" title="' . esc_attr( __( 'View settings', 'wc-checkout-terms-popup' ) ) . '">' . __( 'Settings', 'wc-checkout-terms-popup' ) . '</a>', 142 ); 143 144 return array_merge( $new_actions, $actions ); 145 } 146 147 /** 148 * WooCommerce fallback notice. 149 * @return string 150 */ 151 public function woocommerce_missing_notice() { 152 echo '<div class="error notice is-dismissible"><p>' . sprintf( __( 'WooCommerce Terms & Conditions Popup depends on the last version of %s or later to work!', 'wc-checkout-terms-popup' ), '<a href="http://www.woothemes.com/woocommerce/" target="_blank">' . __( 'WooCommerce 2.3', 'wc-checkout-terms-popup' ) . '</a>' ) . '</p></div>'; 153 } 154 } 155 156 add_action( 'plugins_loaded', array( 'WC_Checkout_Terms_Popup', 'get_instance' ) ); 175 add_action( 'plugins_loaded', array( 'WC_Checkout_Terms_Popup', 'get_instance' ) ); 157 176 158 177 endif; -
wc-checkout-terms-popup/trunk/readme.txt
r1543372 r2061774 4 4 Tags: woocommerce, modal, thickbox, popup, terms, conditions, terms & conditions 5 5 Requires at least: 4.0 6 Tested up to: 4.76 Tested up to: 5.1 7 7 Stable tag: 1.0.0 8 8 License: GPLv3 or later … … 84 84 == Changelog == 85 85 86 = 1.0.1 - 30/11/2016 = 87 * WP Tested upto 5.1 :) 88 86 89 = 1.0.0 - 30/11/2016 = 87 90 * Stable Initial Release. -
wc-checkout-terms-popup/trunk/wc-checkout-terms-popup.php
r1543372 r2061774 4 4 * Plugin URI: http://github.com/shivapoudel/wc-checkout-terms-popup 5 5 * Description: WooCommerce extension to allow your Terms page to open in a popup window during the checkout process. 6 * Version: 1.0. 06 * Version: 1.0.1 7 7 * Author: Shiva Poudel 8 8 * Author URI: http://shivapoudel.com … … 18 18 if ( ! class_exists( 'WC_Checkout_Terms_Popup' ) ) : 19 19 20 /**21 * WC_Checkout_Terms_Popup class.22 */23 class WC_Checkout_Terms_Popup {20 /** 21 * WC_Checkout_Terms_Popup class. 22 */ 23 class WC_Checkout_Terms_Popup { 24 24 25 /** 26 * Plugin version. 27 * @var string 28 */ 29 const VERSION = '1.0.0'; 25 /** 26 * Plugin version. 27 * 28 * @var string 29 */ 30 const VERSION = '1.0.0'; 30 31 31 /** 32 * Instance of this class. 33 * @var object 34 */ 35 protected static $instance = null; 32 /** 33 * Instance of this class. 34 * 35 * @var object 36 */ 37 protected static $instance = null; 36 38 37 /**38 * Initialize the plugin.39 */40 private function __construct() {41 // Load plugin text domain.42 add_action( 'init', array( $this, 'load_plugin_textdomain' ) );39 /** 40 * Initialize the plugin. 41 */ 42 private function __construct() { 43 // Load plugin text domain. 44 add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); 43 45 44 // Checks with WooCommerce is installed.45 if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '2.3', '>=' ) ) {46 $this->includes();46 // Checks with WooCommerce is installed. 47 if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '2.3', '>=' ) ) { 48 $this->includes(); 47 49 48 // Hooks. 49 add_action( 'wp_footer', array( $this, 'load_terms_popup_template' ) ); 50 add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'plugin_action_links' ) ); 51 } else { 52 add_action( 'admin_notices', array( $this, 'woocommerce_missing_notice' ) ); 50 // Hooks. 51 add_action( 'wp_footer', array( $this, 'load_terms_popup_template' ) ); 52 add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'plugin_action_links' ) ); 53 } else { 54 add_action( 'admin_notices', array( $this, 'woocommerce_missing_notice' ) ); 55 } 56 } 57 58 /** 59 * Return an instance of this class. 60 * 61 * @return object A single instance of this class. 62 */ 63 public static function get_instance() { 64 // If the single instance hasn't been set, set it now. 65 if ( is_null( self::$instance ) ) { 66 self::$instance = new self(); 67 } 68 return self::$instance; 69 } 70 71 /** 72 * Load Localisation files. 73 * 74 * Note: the first-loaded translation file overrides any following ones if the same translation is present. 75 * 76 * Locales found in: 77 * - WP_LANG_DIR/wc-checkout-terms-popup/wc-checkout-terms-popup-LOCALE.mo 78 * - WP_LANG_DIR/plugins/wc-checkout-terms-popup-LOCALE.mo 79 */ 80 public function load_plugin_textdomain() { 81 $locale = apply_filters( 'plugin_locale', get_locale(), 'wc-checkout-terms-popup' ); 82 83 load_textdomain( 'wc-checkout-terms-popup', WP_LANG_DIR . '/wc-checkout-terms-popup/wc-checkout-terms-popup-' . $locale . '.mo' ); 84 load_plugin_textdomain( 'wc-checkout-terms-popup', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' ); 85 } 86 87 /** 88 * Get the plugin url. 89 * 90 * @return string 91 */ 92 public static function plugin_url() { 93 return untrailingslashit( plugins_url( '/', __FILE__ ) ); 94 } 95 96 /** 97 * Get the plugin path. 98 * 99 * @return string 100 */ 101 public static function plugin_path() { 102 return untrailingslashit( plugin_dir_path( __FILE__ ) ); 103 } 104 105 /** 106 * Includes. 107 */ 108 private function includes() { 109 include_once dirname( __FILE__ ) . '/includes/class-wc-checkout-terms-popup-scripts.php'; 110 include_once dirname( __FILE__ ) . '/includes/class-wc-checkout-terms-popup-settings.php'; 111 } 112 113 /** 114 * Load terms popup template. 115 */ 116 public function load_terms_popup_template() { 117 $terms_page = get_post( wc_get_page_id( 'terms' ) ); 118 $terms_button = get_option( 'woocommerce_terms_popup_footer_button' ); 119 $terms_scroll = get_option( 'woocommerce_terms_popup_force_scroll_end' ); 120 121 // Make sure WC terms page exists. 122 if ( wc_get_page_id( 'terms' ) > 0 && apply_filters( 'woocommerce_checkout_show_terms', true ) ) { 123 $class_list = array( 'wc-checkout-terms-popup' ); 124 125 // Thickbox class list. 126 if ( 'yes' == $terms_button ) { 127 $class_list[] = 'wc-enabled-terms-button'; 128 129 if ( 'yes' == $terms_scroll ) { 130 $class_list[] = 'wc-enabled-terms-scroll'; 131 } 132 } 133 134 // Load WC checkout terms popup template. 135 wc_get_template( 136 'checkout/terms-popup.php', 137 array( 138 'id' => 'wc-terms-and-conditions-popup', 139 'title' => $terms_page->post_title, 140 'content' => $terms_page->post_content, 141 'class_list' => $class_list, 142 'terms_button' => $terms_button, 143 'terms_scroll' => $terms_scroll, 144 ), 145 '', 146 self::plugin_path() . '/templates/' 147 ); 148 } 149 } 150 151 /** 152 * Display action links in the Plugins list table. 153 * 154 * @param array $actions 155 * @return array 156 */ 157 public function plugin_action_links( $actions ) { 158 $new_actions = array( 159 'settings' => '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=checkout' ) . '" title="' . esc_attr( __( 'View settings', 'wc-checkout-terms-popup' ) ) . '">' . __( 'Settings', 'wc-checkout-terms-popup' ) . '</a>', 160 ); 161 162 return array_merge( $new_actions, $actions ); 163 } 164 165 /** 166 * WooCommerce fallback notice. 167 * 168 * @return string 169 */ 170 public function woocommerce_missing_notice() { 171 echo '<div class="error notice is-dismissible"><p>' . sprintf( __( 'WooCommerce Terms & Conditions Popup depends on the last version of %s or later to work!', 'wc-checkout-terms-popup' ), '<a href="http://www.woothemes.com/woocommerce/" target="_blank">' . __( 'WooCommerce 2.3', 'wc-checkout-terms-popup' ) . '</a>' ) . '</p></div>'; 53 172 } 54 173 } 55 174 56 /** 57 * Return an instance of this class. 58 * @return object A single instance of this class. 59 */ 60 public static function get_instance() { 61 // If the single instance hasn't been set, set it now. 62 if ( is_null( self::$instance ) ) { 63 self::$instance = new self(); 64 } 65 return self::$instance; 66 } 67 68 /** 69 * Load Localisation files. 70 * 71 * Note: the first-loaded translation file overrides any following ones if the same translation is present. 72 * 73 * Locales found in: 74 * - WP_LANG_DIR/wc-checkout-terms-popup/wc-checkout-terms-popup-LOCALE.mo 75 * - WP_LANG_DIR/plugins/wc-checkout-terms-popup-LOCALE.mo 76 */ 77 public function load_plugin_textdomain() { 78 $locale = apply_filters( 'plugin_locale', get_locale(), 'wc-checkout-terms-popup' ); 79 80 load_textdomain( 'wc-checkout-terms-popup', WP_LANG_DIR . '/wc-checkout-terms-popup/wc-checkout-terms-popup-' . $locale . '.mo' ); 81 load_plugin_textdomain( 'wc-checkout-terms-popup', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' ); 82 } 83 84 /** 85 * Get the plugin url. 86 * @return string 87 */ 88 public static function plugin_url() { 89 return untrailingslashit( plugins_url( '/', __FILE__ ) ); 90 } 91 92 /** 93 * Get the plugin path. 94 * @return string 95 */ 96 public static function plugin_path() { 97 return untrailingslashit( plugin_dir_path( __FILE__ ) ); 98 } 99 100 /** 101 * Includes. 102 */ 103 private function includes() { 104 include_once( dirname( __FILE__ ) . '/includes/class-wc-checkout-terms-popup-scripts.php' ); 105 include_once( dirname( __FILE__ ) . '/includes/class-wc-checkout-terms-popup-settings.php' ); 106 } 107 108 /** 109 * Load terms popup template. 110 */ 111 public function load_terms_popup_template() { 112 $terms_page = get_post( wc_get_page_id( 'terms' ) ); 113 $terms_button = get_option( 'woocommerce_terms_popup_footer_button' ); 114 $terms_scroll = get_option( 'woocommerce_terms_popup_force_scroll_end' ); 115 116 // Make sure WC terms page exists. 117 if ( wc_get_page_id( 'terms' ) > 0 && apply_filters( 'woocommerce_checkout_show_terms', true ) ) { 118 $class_list = array( 'wc-checkout-terms-popup' ); 119 120 // Thickbox class list. 121 if ( 'yes' == $terms_button ) { 122 $class_list[] = 'wc-enabled-terms-button'; 123 124 if ( 'yes' == $terms_scroll ) { 125 $class_list[] = 'wc-enabled-terms-scroll'; 126 } 127 } 128 129 // Load WC checkout terms popup template. 130 wc_get_template( 'checkout/terms-popup.php', array( 'id' => 'wc-terms-and-conditions-popup', 'title' => $terms_page->post_title, 'content' => $terms_page->post_content, 'class_list' => $class_list, 'terms_button' => $terms_button, 'terms_scroll' => $terms_scroll ), '', self::plugin_path() . '/templates/' ); 131 } 132 } 133 134 /** 135 * Display action links in the Plugins list table. 136 * @param array $actions 137 * @return array 138 */ 139 public function plugin_action_links( $actions ) { 140 $new_actions = array( 141 'settings' => '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=checkout' ) . '" title="' . esc_attr( __( 'View settings', 'wc-checkout-terms-popup' ) ) . '">' . __( 'Settings', 'wc-checkout-terms-popup' ) . '</a>', 142 ); 143 144 return array_merge( $new_actions, $actions ); 145 } 146 147 /** 148 * WooCommerce fallback notice. 149 * @return string 150 */ 151 public function woocommerce_missing_notice() { 152 echo '<div class="error notice is-dismissible"><p>' . sprintf( __( 'WooCommerce Terms & Conditions Popup depends on the last version of %s or later to work!', 'wc-checkout-terms-popup' ), '<a href="http://www.woothemes.com/woocommerce/" target="_blank">' . __( 'WooCommerce 2.3', 'wc-checkout-terms-popup' ) . '</a>' ) . '</p></div>'; 153 } 154 } 155 156 add_action( 'plugins_loaded', array( 'WC_Checkout_Terms_Popup', 'get_instance' ) ); 175 add_action( 'plugins_loaded', array( 'WC_Checkout_Terms_Popup', 'get_instance' ) ); 157 176 158 177 endif;
Note: See TracChangeset
for help on using the changeset viewer.