/**
  * Prints out the fetched product links.
  * 
  * @remark            Used for the post type single page that functions as preview the result.
  * */
 public function _replytToPrintPreviewProductLinks($sContent)
 {
     if (!is_singular()) {
         return $sContent;
     }
     if (!isset($GLOBALS['post']->post_type) || $GLOBALS['post']->post_type != $this->oProps->strPostType) {
         return $sContent;
     }
     if (!$GLOBALS['oAmazonAutoLinks_Option']->isPreviewVisible()) {
         return $sContent;
     }
     $_aUnitOptions = AmazonAutoLinks_Option::getUnitOptionsByPostID($GLOBALS['post']->ID);
     $_aUnitOptions['id'] = $GLOBALS['post']->ID;
     return $sContent . AmazonAutoLinks_Units::getInstance($_aUnitOptions)->getOutput();
 }
Exemplo n.º 2
0
function AmazonAutoLinks($aArgs)
{
    return AmazonAutoLinks_Units::getInstance($aArgs)->render();
}
 /**
  * Returns the output based on the shortcode arguments.
  * 
  * @since       2.0.0
  * @since       2.1.1       Chagned the name from `getOutput()`.
  */
 public function _replyToGetOutput($aArgs)
 {
     return AmazonAutoLinks_Units::getInstance($aArgs)->getOutput();
 }