Changeset 4524 for trunk/includes/forums/functions.php
- Timestamp:
- 11/26/2012 05:43:43 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/forums/functions.php
r4508 r4524 1944 1944 return; 1945 1945 1946 // Forum is being permanently deleted, so its topics gotta go too 1947 if ( $topics = new WP_Query( array( 1946 // Forum is being permanently deleted, so its content has go too 1947 // Note that we get all post statuses here 1948 $topics = new WP_Query( array( 1948 1949 'suppress_filters' => true, 1949 1950 'post_type' => bbp_get_topic_post_type(), 1950 1951 'post_parent' => $forum_id, 1951 'post_status' => 'any',1952 'post_status' => array_keys( get_post_stati() ), 1952 1953 'posts_per_page' => -1, 1953 1954 'nopaging' => true, 1954 1955 'fields' => 'id=>parent' 1955 ) ) ) { 1956 ) ); 1957 1958 // Loop through and delete child topics. Topic replies will get deleted by 1959 // the bbp_delete_topic() action. 1960 if ( !empty( $topics->posts ) ) { 1956 1961 foreach ( $topics->posts as $topic ) { 1957 1962 wp_delete_post( $topic->ID, true ); … … 1961 1966 wp_reset_postdata(); 1962 1967 } 1968 1969 // Cleanup 1970 unset( $topics ); 1963 1971 } 1964 1972
Note: See TracChangeset
for help on using the changeset viewer.