BBP_Converter_Base::convert_forum_parents( $start )
This method converts old forum heirarchy to new Forums heirarchy.
Description
Source
File: bp-forums/admin/converter.php
1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 | public function convert_forum_parents( $start ) { $has_update = false; if ( ! empty ( $this ->sync_table ) ) { $query = 'SELECT value_id, meta_value FROM ' . $this ->sync_table_name . ' WHERE meta_key = "_bbp_forum_parent_id" AND meta_value > 0 LIMIT ' . $start . ', ' . $this ->max_rows; } else { $query = 'SELECT post_id AS value_id, meta_value FROM ' . $this ->wpdb->postmeta . ' WHERE meta_key = "_bbp_forum_parent_id" AND meta_value > 0 LIMIT ' . $start . ', ' . $this ->max_rows; } update_option( '_bbp_converter_query' , $query ); $forum_array = $this ->wpdb->get_results( $query ); foreach ( ( array ) $forum_array as $row ) { $parent_id = $this ->callback_forumid( $row ->meta_value ); $this ->wpdb->query( 'UPDATE ' . $this ->wpdb->posts . ' SET post_parent = "' . $parent_id . '" WHERE ID = "' . $row ->value_id . '" LIMIT 1' ); $has_update = true; } return ! $has_update ; } |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.