Skip to content

@webaware /gist:3368517
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
kludge to make WordPress' Google Sitemap Generator exclude Page Links To pages linking to PDF files
<?php
function filterSitemapOptions($opts) {
global $wpdb;
// tell it to exclude any pages that are just page-links-to links to PDF files
$exclude = $wpdb->get_col("select post_id from $wpdb->postmeta where meta_key = '_links_to' and meta_value like '%.pdf'");
if (!empty($exclude)) {
$opts['sm_b_exclude'] = array_merge($opts['sm_b_exclude'], $exclude);
}
return $opts;
}
add_filter('option_sm_options', 'filterSitemapOptions');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.