protected function handleCustomActions() { if (!isset($_GET['custom_action'], $_GET['nonce'], $_GET['post'])) { return; } $_sNonce = AmazonAutoLinks_WPUtility::getTransient('AAL_Nonce_' . $_GET['nonce']); if (false === $_sNonce) { add_action('admin_notices', array($this, 'replyToNotifyNonceFailed')); return; } AmazonAutoLinks_WPUtility::deleteTransient('AAL_Nonce_' . $_GET['nonce']); // Currently only the status toggle is supported. if ('toggle_status' === $_GET['custom_action'] && $_GET['post']) { $_aUnitIDs = get_post_meta($_GET['post'], 'unit_ids', true); // if this field is empty, the post must be the wrong post type. if (empty($_aUnitIDs)) { return; } $_bIsEnabled = get_post_meta($_GET['post'], 'status', true); update_post_meta($_GET['post'], 'status', !$_bIsEnabled); } }
public function unlink() { unset($GLOBALS['aSimplePieCacheModTimestamps'][$this->sPluginKey][$this->sFileID]); AmazonAutoLinks_WPUtility::deleteTransient($this->sTransientName); return true; }