/** * Optional implementation to uninstall plugin - can be extended by subclasses, not to be called directly but extended by subclasses * * @api * * @since 1.0 * * @param none * * @return string $message Optional any messages generated by uninstall */ public function uninstall() { if ($this->options) { $this->options->deregister_options(); } //end if }
/** * Process shortcodes passed to widget * * @ignore - Must be public, used by WordPress hook * * @since 1.0 * * @param array $attributes Optional the arguments passed to the shortcode * @param string $content Optional The content that the shortcode contains. Stored to fields[shortcode_content] * * @return none */ public function process_shortcode($attributes, $content = null) { if (is_feed()) { return '[' . $this->options->get_value('name') . ']'; } $shortcode_fields = get_option($this->options->get_value('shortcode-fields-option-name')); $defaults = new TSP_Easy_Dev_Data($shortcode_fields); if (!empty($attributes)) { $fields = $defaults->get_values(true); // Update attributes to include old attribute names from short codes // Backwards compatibility foreach ($fields as $key => $opts) { // continue if this label was renamed if (!empty($opts['old_labels'])) { $new_label = $key; // looop through all the old label names foreach ($opts['old_labels'] as $old_label) { // if the new label isn't being used and the user is using the old label // set the new labels value to the old label's value if (!array_key_exists($new_label, $attributes) && array_key_exists($old_label, $attributes)) { $attributes[$new_label] = $attributes[$old_label]; unset($attributes[$old_label]); } //end fi } //end foreach } //end if } //end foreach } //end if if (!empty($attributes)) { $defaults->set_values($attributes); } else { $defaults->decode_values(); } //endelse $fields = $defaults->get_values(); $fields['shortcode_content'] = $content; $output = $this->display_widget($fields, false); return $output; }