global exclude filter for wp_list_pages(). fixes #3402

git-svn-id: http://svn.automattic.com/wordpress/trunk@4586 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2006-12-03 09:23:17 +00:00
parent 0a6e2b7869
commit b4a405db46
1 changed files with 7 additions and 1 deletions

View File

@ -269,11 +269,17 @@ function wp_list_pages($args = '') {
parse_str($args, $r); parse_str($args, $r);
$defaults = array('depth' => 0, 'show_date' => '', 'date_format' => get_option('date_format'), $defaults = array('depth' => 0, 'show_date' => '', 'date_format' => get_option('date_format'),
'child_of' => 0, 'title_li' => __('Pages'), 'echo' => 1, 'authors' => ''); 'child_of' => 0, 'exclude' => '', 'title_li' => __('Pages'), 'echo' => 1, 'authors' => '');
$r = array_merge($defaults, $r); $r = array_merge($defaults, $r);
$output = ''; $output = '';
// sanitize, mostly to keep spaces out
$r['exclude'] = preg_replace('[^0-9,]', '', $r['exclude']);
// Allow plugins to filter an array of excluded pages
$r['exclude'] = implode(',', apply_filters('wp_list_pages_excludes', explode(',', $r['exclude'])));
// Query pages. // Query pages.
$pages = get_pages($r); $pages = get_pages($r);