if (!$ctc_settings->is_settings_page()) { return; } // Have a result transient? $result = get_transient('ctc_edd_license_activation_result'); if ($result) { // Get result data? $add_on_dir = $result['add_on_dir']; $result = $result['result']; // Have result data? if (!empty($add_on_dir) && !empty($result)) { // Get notice message $notice_message = ctc_get_add_on($add_on_dir, $result . '_notice'); // Output notice if ($notice_message) { // Show notice and hide "Settings saved." notice beneath ?> <div id="ctc-license-notice-<?php echo esc_attr($result); ?> " class="<?php if (preg_match('/success/', $result)) { ?> updated<?php } else { ?>
/** * show update nofication row -- needed for multisite subsites, because WP won't tell you otherwise! * * @param string $file * @param array $plugin */ public function show_update_notification($file, $plugin) { if (!current_user_can('update_plugins')) { return; } if (!is_multisite()) { return; } if ($this->name != $file) { return; } // Remove our filter on the site transient remove_filter('pre_set_site_transient_update_plugins', array($this, 'check_update'), 10); $update_cache = get_site_transient('update_plugins'); if (!is_object($update_cache) || empty($update_cache->response) || empty($update_cache->response[$this->name])) { $cache_key = md5('edd_plugin_' . sanitize_key($this->name) . '_version_info'); $version_info = get_transient($cache_key); if (false === $version_info) { $version_info = $this->api_request('plugin_latest_version', array('slug' => $this->slug)); set_transient($cache_key, $version_info, 3600); } if (!is_object($version_info)) { return; } if (version_compare($this->version, $version_info->new_version, '<')) { $update_cache->response[$this->name] = $version_info; } $update_cache->last_checked = time(); $update_cache->checked[$this->name] = $this->version; set_site_transient('update_plugins', $update_cache); } else { $version_info = $update_cache->response[$this->name]; } // Restore our filter add_filter('pre_set_site_transient_update_plugins', array($this, 'check_update')); if (!empty($update_cache->response[$this->name]) && version_compare($this->version, $version_info->new_version, '<')) { // build a plugin list row, with update notification $wp_list_table = _get_list_table('WP_Plugins_List_Table'); echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">'; $changelog_link = self_admin_url('index.php?edd_sl_action=view_plugin_changelog&plugin=' . $this->name . '&slug=' . $this->slug . '&TB_iframe=true&width=772&height=911'); // CT Mod // Use external changelog URL instead of post-provided changelog embedded in modal $ctc_changelog_url = ctc_get_add_on($this->slug, 'changelog_url'); $ctc_changelog_link_class = 'thickbox'; if ($ctc_changelog_url) { $changelog_link = $ctc_changelog_url; $ctc_changelog_link_class = ''; } // CT Mod // 1. Added CTC textdomain // 2. Added class replacement. If $changelog_link provided, class is none; otherwise class for modal is used if (empty($version_info->download_link)) { printf(__('There is a new version of %1$s available. <a target="_blank" class="%4$s" href="%2$s">View version %3$s details</a>.', 'church-theme-content'), esc_html($version_info->name), esc_url($changelog_link), esc_html($version_info->new_version), $ctc_changelog_link_class); } else { printf(__('There is a new version of %1$s available. <a target="_blank" class="%5$s" href="%2$s">View version %3$s details</a> or <a href="%4$s">update now</a>.', 'church-theme-content'), esc_html($version_info->name), esc_url($changelog_link), esc_html($version_info->new_version), esc_url(wp_nonce_url(self_admin_url('update.php?action=upgrade-plugin&plugin=') . $this->name, 'upgrade-plugin_' . $this->name)), $ctc_changelog_link_class); } echo '</div></td></tr>'; } }