/** * Displays the notice * * @return void */ public function display() { // Bail if not an plugin admin page if (!isset($_GET['page'])) { return; } // Get the current page URL $current_page = "{$_SERVER['REQUEST_URI']}&dismiss_customizer_notice=true"; // Populate the message $message = sprintf(__('The Easing Slider "Customizer" functionality will soon be removed from this plugin and made available as an extension. If you use the "Customize" panel, download and activate the free extension <a href="%s" target="_blank">here</a> to prevents any disruptions. <a href="%s">Dismiss</a>.', 'easingslider'), 'http://easingslider.com/extensions/visual-customizer', $current_page); // Bail if we've dismissed the notice if (get_option('easingslider_dismissed_customizer_notice')) { return; } // Tell the user if (function_exists('easingslider_show_notice')) { easingslider_show_notice($message, 'updated notice'); } }
/** * Does our actions * * @return void */ public function do_actions() { // Continue if the save button has been pressed if (isset($_POST['save'])) { // Bail if nonce is invalid if (!check_admin_referer('save')) { return; } // Get the current settings $settings = get_option('easingslider_settings'); // Merge the updated settings $settings = (object) array_merge((array) $settings, $this->get_form_fields()); // Update the settings update_option('easingslider_settings', $settings); // Trigger actions do_action('easingslider_save_settings_actions'); // Tell the user easingslider_show_notice(__('Settings have been saved successfully.', 'easingslider'), 'updated'); } // Trigger actions do_action('easingslider_do_settings_actions'); }
/** * Does our edit actions * * @return void */ public function do_edit_actions() { // Continue if the save button has been pressed if (isset($_POST['save']) && isset($_GET['edit'])) { // Bail if nonce is invalid if (!check_admin_referer('save')) { return; } // Get and validate the ID, protecting against XSS attacks $id = sanitize_key($_GET['edit']); // Get our slider $slider = ES_Slider::find($id); // Update attributes $slider->set($this->get_form_fields()); // Save the slider $slider->save(); // Trigger actions do_action('easingslider_save_slider_actions', $slider); // Tell the user easingslider_show_notice(__('Slider has been saved successfully.', 'easingslider'), 'updated'); } // Trigger actions do_action('easingslider_do_editor_actions'); }
/** * Attempts to deactive the license key for this site * * @return void */ public function attempt_deactivation() { // Bail if not deactivating this license if (!isset($_POST["deactivate-{$this->slug}"])) { return; } // Check security nonce if (!check_admin_referer('save')) { return; } // Attempt to deactivate the license $response = $this->deactivate(); // Handle response if (true === $response) { // Tell the user the license was registered successfully. easingslider_show_notice(sprintf(__('"%s" License has been deactivated successfully.', 'easingslider'), $this->name), 'updated notice'); } else { // Tell the user we failed to deactivate the license easingslider_show_notice($response, 'error'); } }