'info', 'taxonomy' => array( array( 'taxoName' => 'info-cat', 'taxoLabel' => '') ), 'label' => $biz_vektor_options['infoLabelName'], 'link' => home_url( '/info/' ) ), array( 'post-type' => 'post', 'taxonomy' => array( array( 'taxoName' => 'category', 'taxoLabel' => '') ), 'label' => $biz_vektor_options['postLabelName'], 'link' => $biz_vektor_options['postTopUrl'] )); //pages to exclude $pages = ''; //gets advanced options saved by administrator from DB $advancedOptions = Biz_Vektor_Advanced_Options::getAdvancedOptions(); if ( isset($advancedOptions) ) { //adds custom post types names, hierarchical taxonomies (categories), details to $types array if ( isset($advancedOptions['types']) && !empty($advancedOptions['types']) ) { $i = count($types); foreach ( $advancedOptions['types'] as $typeName ) { //checks if post type exists $typeObj = get_post_type_object($typeName); if ( isset($typeObj) ) { $types[$i]['post-type'] = $typeName; //gets custom post type infos based on default Wordpress behaviour $types[$i]['link'] = home_url( '/' . $typeName ); $types[$i]['label'] = get_post_type_object( $typeName )->labels->name; //gets all taxonomies of custom type $typeTaxo = get_object_taxonomies( $typeName, 'objects' ); //looks for category (hierarchical taxonomy) if ( isset($typeTaxo) && !empty($typeTaxo) ) { $j = 0; foreach ( $typeTaxo as $taxoName => $taxoObj ) { if ( $taxoObj->hierarchical ) { $types[$i]['taxonomy'][$j]['taxoName'] = $taxoName; $types[$i]['taxonomy'][$j]['taxoLabel'] = $taxoObj->labels->name; $j++; } } } $i++; } } } //adds id of pages to remove from sitemap (array to string) if ( isset($advancedOptions['pages']) && !empty($advancedOptions['pages']) ) { $length = count($advancedOptions['pages']); if ( $length > 1 ) $pages = implode( ',', $advancedOptions['pages'] ); else $pages = $advancedOptions['pages'][0]; } } ?>