This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

BBP_Converter_Base::callback_forumid( string $field )

A mini cache system to reduce database calls to forum ID’s

Description

Parameters

$field

(Required)

Return

(string)

Source

File: bp-forums/admin/converter.php

1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
private function callback_forumid( $field ) {
    if ( !isset( $this->map_forumid[$field] ) ) {
        if ( !empty( $this->sync_table ) ) {
            $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_forum_id" AND meta_value = "%s" LIMIT 1', $field ) );
        } else {
            $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT post_id AS value_id FROM ' . $this->wpdb->postmeta . ' WHERE meta_key = "_bbp_forum_id" AND meta_value = "%s" LIMIT 1', $field ) );
        }
 
        if ( !is_null( $row ) ) {
            $this->map_forumid[$field] = $row->value_id;
        } else {
            $this->map_forumid[$field] = 0;
        }
    }
    return $this->map_forumid[$field];
}

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.