BP_Media_Model::delete( $value, bool $media_id = false )

Delete from the table

Description

Parameters

$value

(Required)

$media_id

(Optional)

Default value: false

Return

(bool|false|int)

Source

File: bp-media/classes/class-bp-media-model.php

	static function delete( $value, $media_id = false ) {
		global $wpdb;

		if ( empty( $media_id ) ) {
			$media    = self::get( $value );
			$media_id = $media->media_id;
		}
		wp_delete_post( $media_id, true );

		$sql = sprintf( 'DELETE FROM %s WHERE %s = %%s', self::_table(), static::$primary_key );

		return $wpdb->query( $wpdb->prepare( $sql, $value ) );
	}

Changelog

Changelog
Version Description
BuddyBoss 1.0.0 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.