WordPress.org

Make WordPress Core

Changeset 4586


Ignore:
Timestamp:
12/03/2006 09:23:17 AM (11 years ago)
Author:
markjaquith
Message:

global exclude filter for wp_list_pages(). fixes #3402

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post-template.php

    r4552 r4586  
    270270
    271271    $defaults = array('depth' => 0, 'show_date' => '', 'date_format' => get_option('date_format'),
    272         'child_of' => 0, 'title_li' => __('Pages'), 'echo' => 1, 'authors' => '');
     272        'child_of' => 0, 'exclude' => '', 'title_li' => __('Pages'), 'echo' => 1, 'authors' => '');
    273273    $r = array_merge($defaults, $r);
    274274
    275275    $output = '';
     276
     277    // sanitize, mostly to keep spaces out
     278    $r['exclude'] = preg_replace('[^0-9,]', '', $r['exclude']);
     279
     280    // Allow plugins to filter an array of excluded pages
     281    $r['exclude'] = implode(',', apply_filters('wp_list_pages_excludes', explode(',', $r['exclude'])));
    276282
    277283    // Query pages.
Note: See TracChangeset for help on using the changeset viewer.