| 1 |
<?php |
| 2 |
defined('ABSPATH') || die('Access Denied'); |
| 3 |
|
| 4 |
class REACG_Shortcode { |
| 5 |
private $obj; |
| 6 |
|
| 7 |
public function __construct($that) { |
| 8 |
$this->obj = $that; |
| 9 |
|
| 10 |
add_shortcode($that->shortcode, array($this, 'content')); |
| 11 |
} |
| 12 |
|
| 13 |
public function content( $params = array() ) { |
| 14 |
if ( (is_admin() && defined('DOING_AJAX') && !DOING_AJAX) || !isset($params['id']) ) { |
| 15 |
return false; |
| 16 |
} |
| 17 |
|
| 18 |
$id = (int) $params['id']; |
| 19 |
|
| 20 |
return str_replace(array( "\r\n", "\n", "\r" ), '', REACGLibrary::get_rest_routs($id)); |
| 21 |
} |
| 22 |
} |
| 23 |
|