Simple Sitemap and Custom Press

Hey There,

I am using Custom Press and Simple sitemaps and I was having an issue where my custom content types were not being recognized by simple sitemaps. I modified the plugin so now all the content types are recognized below, also when a new custom content 'page' was created the sitemap was not being updated, I tweaked those in the second content block.

$pageargs = array(
			'numberposts' =>  500,
			'post_type' => array( 'page', 'events', 'biographies', 'news', 'blog', '..whatever' )
		);
		$latestpages = $totalpages ? get_posts( $pageargs ) : array();
function Incsub_SimpleSitemaps() {
		// Delete cached sitemaps on new post or post delete
		add_action( 'publish_post', array(&$this, 'DeleteSitemap'), 15 );
		add_action( 'delete_post', array(&$this, 'DeleteSitemap'), 15 );
		add_action( 'publish_page', array(&$this, 'DeleteSitemap'), 15 ); //new
		add_action( 'trashed_post', array(&$this, 'DeleteSitemap'), 15 ); //new
  ...
  • aecnu
    • WP Unicorn

    Greetings CramerDevelopers,

    Thank you for the great code snippet contribution you made to the WPMU Dev Community and I am sure that some members will appreciate it as well.

    I will also let the lead developer @Vladislav know of this contribution as well.

    Thank again and for being a WPMU Dev Community Member!

    Cheers, Joe

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.