ยต compatible. Author: Oncle Tom Version: 2.0-dev Author URI: http://case.oncle-tom.net/ Plugin URI: hhttp://wordpress.org/extend/plugins/amazon-widgets-shortcodes/ This plugin is released under version 3 of the GPL: http://www.opensource.org/licenses/gpl-3.0.html */ /* * Bootstrap */ require_once dirname(__FILE__).'/lib/Plugin.class.php'; spl_autoload_register(array('AWShortcodesPlugin', 'autoload')); try { $AWShortcodesPlugin = AWShortcodesPlugin::createInstance(new AWShortcodesConfiguration(__FILE__)); $AWShortcodesConfiguration = $AWShortcodesPlugin->getConfiguration(); $AWShortcodesOptions = $AWShortcodesConfiguration->getOptions(); } catch (AWShortcodesException $e) { wp_die((string)$e); } catch (Exception $e) { wp_die(sprintf('Amazon Widgets Shortcodes initialization error: %s', $e->getMessage())); } /* * Admin stuff */ if (is_admin() && !defined('WP_UNINSTALL_PLUGIN')) { $AWShortcodesAdmin = AWShortcodesAdmin::createInstance($AWShortcodesConfiguration); add_action('admin_menu', array($AWShortcodesAdmin, 'setupAdminMenu')); add_filter('whitelist_options', array($AWShortcodesAdmin, 'setupOptionsWhitelist')); if ((string)$AWShortcodesOptions->inline_documentation) { add_action('edit_form_advanced', array($AWShortcodesAdmin, 'displayDocumentationInline')); } if (!(string)$AWShortcodesOptions->default_profile) { add_action('admin_notices', array($AWShortcodesAdmin, 'printNotice')); } } /* * Frontend stuff */ if ((string)$AWShortcodesOptions->default_profile && !is_admin() && !defined('WP_UNINSTALL_PLUGIN')) { add_action('parse_query', array($AWShortcodesPlugin, 'registerShortcodes')); add_filter('the_excerpt', array('AWShortcodesFilters', 'FormatXhtmlPost'), 999); add_filter('the_content', array('AWShortcodesFilters', 'FormatXhtmlPost'), 999); /* * We enqueue Amazon JS at the bottom * Why the bottom ? Because it is recommended for external scripts * And it is one ;-) * * @see http://developer.yahoo.net/blog/archives/2007/07/high_performanc_5.html */ if ((string)$AWShortcodesOptions->context_links) { add_filter('the_excerpt', array('AWShortcodesToolContextLink', 'filterContextLinks'), 900); add_filter('the_content', array('AWShortcodesToolContextLink', 'filterContextLinks'), 900); add_action('wp_footer', array('AWShortcodesToolContextLink', 'getHtmlCode')); } if ((string)$AWShortcodesOptions->product_preview) { add_action('wp_footer', array('AWShortcodesToolProductPreview', 'getHtmlCode')); } } /* * Global stuff */ add_action('init', array('AWShortcodesRteTinyMce', 'bootstrap'));