BBP_Converter_Base::convert_topic_stickies( $start )

This method converts old topic stickies to new Forums stickies.

Description

Source

File: bp-forums/admin/converter.php

	public function convert_topic_stickies( $start ) {

		$has_update = false;

		if ( !empty( $this->sync_table ) ) {
			$query = 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_sticky_status" AND meta_value = "sticky" LIMIT ' . $start . ', ' . $this->max_rows;
		} else {
			$query = 'SELECT post_id AS value_id, meta_value FROM ' . $this->wpdb->postmeta . ' WHERE meta_key = "_bbp_old_sticky_status" AND meta_value = "sticky" LIMIT ' . $start . ', ' . $this->max_rows;
		}

		update_option( '_bbp_converter_query', $query );

		$sticky_array = $this->wpdb->get_results( $query );

		foreach ( (array) $sticky_array as $row ) {
			bbp_stick_topic( $row->value_id );
			$has_update = true;
		}

		return ! $has_update;
	}

Changelog

Changelog
Version Description
bbPress (r) Introduced.

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.