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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
<?php
if ( !class_exists( 'bkap_approve_booking' ) ) {
class bkap_approve_booking {
private $slug = NULL;
private $title = NULL;
private $content = NULL;
private $author = NULL;
private $date = NULL;
private $type = NULL;
public function __construct( $args ) {
if ( !isset( $args[ 'slug' ] ) ) {
throw new Exception( 'No slug given for page' );
}
$this->slug = $args[ 'slug' ];
$this->title = isset( $args[ 'title' ] ) ? $args[ 'title' ] : '';
$this->content = isset( $args[ 'content' ] ) ? $args[ 'content' ] : '';
$this->author = isset( $args[ 'author' ] ) ? $args[ 'author' ] : 1;
$this->date = isset( $args[ 'date' ] ) ? $args[ 'date' ] : current_time( 'mysql' );
$this->dategmt = isset( $args[ 'date' ] ) ? $args[ 'date' ] : current_time( 'mysql', 1 );
$this->type = isset( $args[ 'type' ] ) ? $args[ 'type' ] : 'page';
add_action( 'booking_page_woocommerce_history_page', array( &$this, 'create_virtual_page' ) );
add_action( 'booking_page_operator_bookings', array( &$this, 'create_virtual_page' ) );
}
public function create_virtual_page( ) {
echo $this->content;
}
}
}