### Eclipse Workspace Patch 1.0
#P wordress 2.7
|
|
|
|
| 2113 | 2113 | |
| 2114 | 2114 | $exclusions = ''; |
| 2115 | 2115 | if ( !empty($exclude) ) { |
| 2116 | | $expages = preg_split('/[\s,]+/',$exclude); |
| | 2116 | $expages = array_map('intval', explode(',', $exclude)); |
| 2117 | 2117 | if ( count($expages) ) { |
| 2118 | 2118 | foreach ( $expages as $expage ) { |
| 2119 | 2119 | if (empty($exclusions)) |
| … |
… |
|
| 2122 | 2122 | $exclusions .= $wpdb->prepare(' AND ID <> %d ', $expage); |
| 2123 | 2123 | } |
| 2124 | 2124 | } |
| | 2125 | if (!empty($exclusions)) |
| | 2126 | $exclusions .= ')'; |
| 2125 | 2127 | } |
| 2126 | | if (!empty($exclusions)) |
| 2127 | | $exclusions .= ')'; |
| 2128 | 2128 | |
| 2129 | 2129 | $author_query = ''; |
| 2130 | 2130 | if (!empty($authors)) { |
| … |
… |
|
| 2188 | 2188 | $pages = & get_page_children($child_of, $pages); |
| 2189 | 2189 | |
| 2190 | 2190 | if ( !empty($exclude_tree) ) { |
| 2191 | | $exclude = array(); |
| 2192 | | |
| 2193 | | $exclude = (int) $exclude_tree; |
| 2194 | | $children = get_page_children($exclude, $pages); |
| 2195 | | $excludes = array(); |
| 2196 | | foreach ( $children as $child ) |
| 2197 | | $excludes[] = $child->ID; |
| 2198 | | $excludes[] = $exclude; |
| | 2191 | $excludes = array_map('intval', explode(',', $exclude_tree)); |
| | 2192 | |
| | 2193 | // exclude tree will work as describben - self and direct childs only (!) |
| 2199 | 2194 | $total = count($pages); |
| 2200 | 2195 | for ( $i = 0; $i < $total; $i++ ) { |
| 2201 | | if ( in_array($pages[$i]->ID, $excludes) ) |
| | 2196 | if ( in_array($pages[$i]->ID, $excludes) || |
| | 2197 | in_array($pages[$i]->post_parent, $excludes)) |
| 2202 | 2198 | unset($pages[$i]); |
| 2203 | 2199 | } |
| 2204 | 2200 | } |
| 2205 | | |
| | 2201 | |
| 2206 | 2202 | $cache[ $key ] = $pages; |
| 2207 | 2203 | wp_cache_set( 'get_pages', $cache, 'posts' ); |
| 2208 | 2204 | |