Changeset 6715
- Timestamp:
- 09/26/2017 07:11:40 PM (9 years ago)
- Location:
- trunk/src/includes/admin
- Files:
-
- 2 edited
-
classes/class-bbp-converter-base.php (modified) (1 diff)
-
tools/repair.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/classes/class-bbp-converter-base.php
r6681 r6715 841 841 /** Delete topics/forums/posts ****************************************/ 842 842 843 $query = ! empty( $this->sync_table ) 844 ? $this->wpdb->prepare( "SELECT value_id FROM {$this->sync_table_name} INNER JOIN {$this->wpdb->posts} ON(value_id = ID) WHERE meta_key LIKE '_bbp_%' AND value_type = %s GROUP BY value_id ORDER BY value_id DESC LIMIT {$this->max_rows}", 'post' ) 845 : $this->wpdb->prepare( "SELECT post_id AS value_id FROM {$this->wpdb->postmeta} WHERE meta_key LIKE %s GROUP BY post_id ORDER BY post_id DESC LIMIT {$this->max_rows}", $this->wpdb->esc_like( '_bbp_' ) . '%' ); 843 $esc_like = $this->wpdb->esc_like( '_bbp_' ) . '%'; 844 $query = ! empty( $this->sync_table ) 845 ? $this->wpdb->prepare( "SELECT value_id FROM {$this->sync_table_name} INNER JOIN {$this->wpdb->posts} ON(value_id = ID) WHERE meta_key LIKE %s AND value_type = %s GROUP BY value_id ORDER BY value_id DESC LIMIT {$this->max_rows}", $esc_like, 'post' ) 846 : $this->wpdb->prepare( "SELECT post_id AS value_id FROM {$this->wpdb->postmeta} WHERE meta_key LIKE %s GROUP BY post_id ORDER BY post_id DESC LIMIT {$this->max_rows}", $esc_like ); 846 847 847 848 $posts = $this->get_results( $query, ARRAY_A ); -
trunk/src/includes/admin/tools/repair.php
r6668 r6715 1014 1014 $bbp_db = bbp_db(); 1015 1015 $statement = esc_html__( 'Repairing closed topics… %s', 'bbpress' ); 1016 $result = esc_html__( 'No closed topics to repair.', 'bbpress' );1016 $result = esc_html__( 'No closed topics to repair.', 'bbpress' ); 1017 1017 $changed = 0; 1018 1018 1019 1019 // Results 1020 $query = "SELECT ID FROM `{$bbp_db->posts}` WHERE `post_type` = '%s' AND `post_status` = 'closed'";1021 $prepare = $bbp_db->prepare( $query, bbp_get_topic_post_type() );1020 $query = "SELECT ID FROM `{$bbp_db->posts}` WHERE `post_type` = %s AND `post_status` = %s"; 1021 $prepare = $bbp_db->prepare( $query, bbp_get_topic_post_type(), bbp_get_closed_status_id() ); 1022 1022 $closed_topics = $bbp_db->get_col( $prepare ); 1023 1023
Note: See TracChangeset
for help on using the changeset viewer.