| 1 |
<?php |
| 2 |
|
| 3 |
namespace Booktics\Shortcode; |
| 4 |
|
| 5 |
/** |
| 6 |
* Service View shortcode class |
| 7 |
*/ |
| 8 |
class Service_Shortcode { |
| 9 |
/** |
| 10 |
* Constructor for service view shortcode |
| 11 |
* |
| 12 |
* @return void |
| 13 |
*/ |
| 14 |
public function __construct() { |
| 15 |
add_shortcode( |
| 16 |
'booktics-service-view', array( |
| 17 |
$this, |
| 18 |
'render_service_view', |
| 19 |
) |
| 20 |
); |
| 21 |
} |
| 22 |
|
| 23 |
/** |
| 24 |
* Render service view |
| 25 |
* |
| 26 |
* @param array $attributes |
| 27 |
* |
| 28 |
* @return string |
| 29 |
*/ |
| 30 |
public function render_service_view( $attributes ) { |
| 31 |
$id = isset( $attributes['id'] ) ? $attributes['id'] : ''; |
| 32 |
|
| 33 |
return "<div class='booktics-shortcode-wrapper'> |
| 34 |
<div class='booktics-single-service-wrapper' |
| 35 |
data-id='" . esc_attr( $id ) . "'> |
| 36 |
</div> |
| 37 |
</div>"; |
| 38 |
} |
| 39 |
} |
| 40 |
|