Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Announcing Unofficial Version 1.2 of bp-skeleton-component

You’ve gone and tempted fate now. Here’s the first something I noticed in bp-example-classes.php:

function bp_example_tablename( $id = null ) {
if ( $id ) {
$this->id = $id;
$this->populate( $this->id );
}
}

/**
* populate()
*
* This method will populate the object with a row from the database, based on the
* ID passed to the constructor.
*/
function populate() {
global $wpdb, $bp, $creds;

if ( $row = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->example->table_name} WHERE id = %d", $this->id ) ) ) {
$this->field_1 = $row->field_1;
$this->field_2 = $row->field_2;
$this->field_3 = $row->field_3;
}
}

;)

I think, but aren’t sure and am not going to go back to test right now, that I have to move the call that created the admin menu – it wasn’t working out of the box.

Skip to toolbar