item.php
564 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/**
* A uniform wrapper for various types of WP objects, i.e. posts or users.
*/
abstract class P2P_Item {
protected $item;
function __construct( $item ) {
$this->item = $item;
}
function __isset( $key ) {
return isset( $this->item->$key );
}
function __get( $key ) {
return $this->item->$key;
}
function __set( $key, $value ) {
$this->item->$key = $value;
}
function get_object() {
return $this->item;
}
function get_id() {
return $this->item->ID;
}
abstract function get_permalink();
abstract function get_title();
}