/** * Sets up the properties for the criteria of page types, taxonomies etc. * * @remark The $wp_query object has to be set priort to calling this method. */ public function _replyToSetUpPageTypeProperties() { if (count($this->arrAutoInsertIDs) == 0) { return; } $this->intPostID = $this->getPostID(); $this->arrDisplayedPageTypes = array('is_single' => is_single(), 'is_singular' => is_singular(), 'is_home' => is_home() || is_front_page(), 'is_archive' => is_archive(), 'is_404' => is_404(), 'is_search' => is_search()); // The below are nothing to do with pages that don't have a post ID. if (!$this->intPostID) { return; } $this->strPostType = get_post_type($this->intPostID); $this->arrTermIDs = array(); $arrTaxonomies = AmazonAutoLinks_WPUtilities::getPostTaxonomies($this->intPostID); foreach ($arrTaxonomies as $strTaxonomySlug => $oTaxonomy) { $arrTaxonomyTerms = wp_get_post_terms($this->intPostID, $strTaxonomySlug); foreach ($arrTaxonomyTerms as $oTerm) { $this->arrTermIDs[] = $oTerm->term_id; } } $this->arrTermIDs = array_unique($this->arrTermIDs); }