Created
October 1, 2014 14:27
-
-
Save lumpysimon/2942fa7d71859c35f566 to your computer and use it in GitHub Desktop.
Better XML Sitemaps (WordPress plugin): set cache folder and exclude pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined( 'ABSPATH' ) or die(); | |
$ll_sitemap = new ll_sitemap; | |
class ll_sitemap { | |
function __construct() { | |
add_filter( 'bwp_gxs_cache_dir', array( $this, 'cache_dir' ) ); | |
add_filter( 'bwp_gxs_excluded_posts', array( $this, 'exclude_pages' ), 10, 2 ); | |
} | |
function cache_dir() { | |
return WP_CONTENT_DIR . '/sitemaps'; | |
} | |
function exclude_pages( $excluded, $post_type ) { | |
switch ( $post_type ) { | |
case 'page' : | |
return array( 7, 8, 42, 94, 95, 122, 123, 145 ); | |
break; | |
} | |
return array(); | |
} | |
} // class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment