| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
* SOFTWARE LICENSE INFORMATION |
| 5 |
* |
| 6 |
* Copyright (c) 2017 Buttonizer, all rights reserved. |
| 7 |
* |
| 8 |
* This file is part of Buttonizer |
| 9 |
* |
| 10 |
* For detailed information regarding to the licensing of |
| 11 |
* this software, please review the license.txt or visit: |
| 12 |
* https://buttonizer.pro/license/ |
| 13 |
*/ |
| 14 |
namespace Buttonizer\Legacy\Api; |
| 15 |
|
| 16 |
use Buttonizer\Api\Settings\MigrateToStandalone; |
| 17 |
/** |
| 18 |
* Initialize api |
| 19 |
*/ |
| 20 |
class Api { |
| 21 |
private static $authenticated = false; |
| 22 |
|
| 23 |
/** |
| 24 |
* Register API endpoints |
| 25 |
*/ |
| 26 |
public function __construct() { |
| 27 |
// Frontend api endpoints |
| 28 |
( new Buttons\ApiButtons() )->registerRoute(); |
| 29 |
// Migration route |
| 30 |
( new MigrateToStandalone() )->registerRoute(); |
| 31 |
} |
| 32 |
|
| 33 |
/** |
| 34 |
* Return error, need Buttonizer pro |
| 35 |
*/ |
| 36 |
public static function needButtonizerPremium() { |
| 37 |
return new \WP_Error('missing_premium_license', 'You do not have Buttonizer Pro.', [ |
| 38 |
'status' => 403, |
| 39 |
]); |
| 40 |
} |
| 41 |
|
| 42 |
} |
| 43 |
|