AdminPageFrameworkLoader_AdminPage_Addon_Top::_getFeedListItem PHP Метод

_getFeedListItem() приватный Метод

Returns an HTML output from the given feed item array.
private _getFeedListItem ( array $aItem, array &$aColumnInfo, array $aColumnOption, $sSiteURLWOQuery = '' ) : string
$aItem array
$aColumnInfo array
$aColumnOption array
Результат string
    private function _getFeedListItem(array $aItem, array &$aColumnInfo, array $aColumnOption, $sSiteURLWOQuery = '')
    {
        // Initial checks
        if (!isset($aItem['title'])) {
            return '';
        }
        // Format
        $aItem = $aItem + array('label' => __('Get it Now', 'admin-page-framework-loader'), 'content' => null, 'description' => null, 'title' => null, 'date' => null, 'author' => null, 'link' => null);
        // Increment the position
        $aColumnInfo['iCurrColPos']++;
        // Making the target '_blank' causes the Feedburner redirect to fail so set no target.
        // $_sLinkURLWOQuery   = preg_replace( '/\?.*/', '', $aItem['link'] );
        // $_sTarget           = false === strpos( $_sLinkURLWOQuery , $sSiteURLWOQuery )
        // ? '_blank'
        // : '';
        $_sTarget = '';
        // Enclose the item buffer into the item container
        $_sItem = '<div class="' . $aColumnOption['sClassAttrCol'] . ' apfl_col_element_of_' . $aColumnOption['iMaxCols'] . ' ' . ' apfl_extension ' . (1 == $aColumnInfo['iCurrColPos'] ? $aColumnOption['sClassAttrFirstCol'] : '') . '"' . '>' . '<div class="apfl_addon_item">' . "<h4 class='apfl_feed_item_title'>{$aItem['title']}</h4>" . "<div class='apfl_feed_item_description'>" . $aItem['description'] . "</div>" . "<div class='get-now apfl_feed_item_link_button'>" . "<a href='" . esc_url($aItem['link']) . "' target='{$_sTarget}' rel='nofollow' class='button button-secondary'>" . $aItem['label'] . "</a>" . "</div>" . '</div>' . '</div>';
        // If it's the first item in the row, add the class attribute.
        // Be aware that at this point, the tag will be unclosed. Therefore, it must be closed later at some point.
        if (1 == $aColumnInfo['iCurrColPos']) {
            $aColumnInfo['bRowTagOpened'] = true;
            $_sItem = '<div class="' . $aColumnOption['sClassAttrRow'] . '">' . $_sItem;
        }
        // If the current column position reached the set max column, increment the current position of row
        if (0 === $aColumnInfo['iCurrColPos'] % $aColumnOption['iMaxCols']) {
            $aColumnInfo['iCurrRowPos']++;
            // increment the row number
            $aColumnInfo['iCurrColPos'] = 0;
            // reset the current column position
            $_sItem .= '</div>';
            // close the section(row) div tag
            $aColumnInfo['bRowTagClosed'] = true;
        }
        return $_sItem;
    }