Skip to content

Instantly share code, notes, and snippets.

@ninnypants
Created November 10, 2011 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ninnypants/1355629 to your computer and use it in GitHub Desktop.
Save ninnypants/1355629 to your computer and use it in GitHub Desktop.
Permalink export for Dustin Nay - changed location of function call.
<?php
add_filter('template_include', 'export_perms');
function export_perms(){
$posts = get_posts(array(
'post_type' => array('post', 'page'),
'numberposts' => -1,
));
$perms = '';
foreach($posts as $post){
setup_postdata($post);
$perms .= get_the_permalink().', ';
}
echo trim($perms, ',');
exit;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment