/** * Triggers event actions. */ public function __construct() { // @todo check the count of posts of the button post type. $_oPostCount = wp_count_posts(AmazonAutoLinks_Registry::$aPostTypes['button']); if (!is_object($_oPostCount)) { return; } // If a button exists, return if (isset($_oPostCount->publish) && $_oPostCount->publish <= 0) { // Otherwise, create one. $this->_createDefaultButton(); } // Update the button CSS option. update_option(AmazonAutoLinks_Registry::$aOptionKeys['button_css'], AmazonAutoLinks_PluginUtility::getCSSRulesOfActiveButtons()); }
/** * Updates the active button CSS rules. * @callback action shutdown */ public function replyToUpdateButtonCSSOnShutdown() { update_option(AmazonAutoLinks_Registry::$aOptionKeys['button_css'], AmazonAutoLinks_PluginUtility::getCSSRulesOfActiveButtons()); }