$option) { add_option( $id, $option['defaultValue'], '', (bool)$option['autoload'] ? 'yes' : 'no' ); } /* * Purge TinyMCE config */ $js_cache_dir = WP_CONTENT_DIR.'/uploads/js_cache'; $dp = opendir($js_cache_dir); while ($element = readdir($dp)) { if (preg_match('/^tinymce/', $element) && is_file($js_cache_dir.'/'.$element)) { unlink($js_cache_dir.'/'.$element); } } closedir($dp); } /** * Filter action plugin action links to add context links * * @author oncletom * @version 1.0 * @since 1.4 * @return array * @param array $action_links */ function executeFilterPluginActionLinks($action_links) { return array_merge(array(''.__('Configure').''), $action_links); } /** * Removes all data set by the plugin, including custom settings * * Note : in use if the function `register_uninstall_hook` is implemented * Either in a case of a plugin or Core WP files * * @static * @author oncletom * @version 2.0 * @since 1.3 * @return null */ function executeUninstall() { foreach (array_keys(AmazonWidgetsShortcodes::getRegisteredOptions()) as $option_id) { delete_option($option_id); } } /** * Register shortcode class & syntax * * @author oncletom * @version 1.0 * @since 1.3 * @return $registered_shortcodes Integer Number of registered shortcodes */ function registerShortcodes() { $registered_shortcodes = 0; require AWS_PLUGIN_BASEPATH.'/lib/widgets/AmazonWidgetsShortcodeBase.class.php'; foreach (AmazonWidgetsShortcodeConfiguration::getShortcodes() as $shortcode_id => $shortcode_config) { require AWS_PLUGIN_BASEPATH.'/lib/widgets/'.$shortcode_config['class'].'.class.php'; add_shortcode($shortcode_id, array($shortcode_config['class'], 'displayAsHtml')); $registered_shortcodes++; } return $registered_shortcodes; } }