public function column_default($arrItem, $strColumnName) { // 'column_' + 'default' switch ($strColumnName) { case 'description': //Build row actions $arrActions = array('version' => sprintf(__('Version', 'amazon-auto-links') . ' ' . $arrItem['strVersion']), 'author' => sprintf('<a href="%s">' . $arrItem['strAuthor'] . '</a>', $arrItem['strAuthorURI']), 'css' => sprintf('<a href="%s">' . __('CSS', 'amazon-auto-links') . '</a>', AmazonAutoLinks_WPUtilities::getSRCFromPath($arrItem['strCSSPath']))); //Return the title contents return sprintf('%1$s <div class="active second">%2$s</div>', $arrItem['strDescription'], $this->row_actions($arrActions)); case 'thumbnail': if (!file_exists($arrItem['strThumbnailPath'])) { return; } $strImageURL = AmazonAutoLinks_WPUtilities::getSRCFromPath($arrItem['strThumbnailPath']); // $strImageURL = site_url() . "?amazon_auto_links_image=" . base64_encode( $arrItem['strThumbnailPath'] ); return "<a class='template-thumbnail' href='#thumb'>" . "<img src='{$strImageURL}' style='max-width:80px; max-height:80px;' />" . "<span>" . "<div>" . "<img src='{$strImageURL}' /><br />" . $arrItem['strName'] . "</div>" . "</span>" . "</a>"; default: return print_r($arrItem, true); //Show the whole array for troubleshooting purposes } }
/** * Enqueues activated templates' CSS file. * */ public function enqueueActiveTemplateStyles() { // This must be called after the option object has been established. foreach ($this->getActiveTemplates() as $arrTemplate) { if (!$this->doFilesExist(array($arrTemplate['strCSSPath'], $arrTemplate['strTemplatePath']))) { continue; } wp_register_style("amazon-auto-links-{$arrTemplate['strID']}", AmazonAutoLinks_WPUtilities::getSRCFromPath($arrTemplate['strCSSPath'])); // wp_register_style( "amazon-auto-links-{$arrTemplate['strID']}", site_url() . "?amazon_auto_links_style={$arrTemplate['strID']}" ); wp_enqueue_style("amazon-auto-links-{$arrTemplate['strID']}"); } }