PluginProbe
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments / 4.2.3
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments v4.2.3
4.7.2 4.7.1 4.7.0 4.6.6 4.6.5 4.6.4 4.6.3 4.6.2 4.6.1 4.6.0 4.5.1 4.5.0 4.4.2 4.4.1 4.4.0 4.3.3 4.3.2 4.3.1 4.3.0 4.2.3 4.2.2 4.2.1 1.0.3 1.0.4 1.0.5 All 281 releases
surecart / app / src / Controllers / Admin / AffiliationRequests / AffiliationRequestsController.php
AffiliationRequestsController.php
50 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace SureCart\Controllers\Admin\AffiliationRequests;
4
5 use SureCart\Controllers\Admin\AdminController;
6 use SureCart\Controllers\Admin\AffiliationRequests\AffiliationRequestsListTable;
7
8 /**
9 * Handles affiliate requests admin routes.
10 */
11 class AffiliationRequestsController extends AdminController {
12 /**
13 * Affiliate Requests index.
14 */
15 public function index() {
16 $table = new AffiliationRequestsListTable();
17 $table->prepare_items();
18 $this->withHeader(
19 array(
20 'breadcrumbs' => [
21 'affiliate-requests' => [
22 'title' => __( 'Affiliate Requests', 'surecart' ),
23 ],
24 ],
25 )
26 );
27 return \SureCart::view( 'admin/affiliation-requests/index' )->with( [ 'table' => $table ] );
28 }
29
30 /**
31 * Edit
32 */
33 public function edit( $request ) {
34 // enqueue needed script.
35 add_action( 'admin_enqueue_scripts', \SureCart::closure()->method( AffiliationRequestsScriptsController::class, 'enqueue' ) );
36
37 $this->preloadPaths(
38 [
39 '/wp/v2/users/me',
40 '/wp/v2/types?context=view',
41 '/wp/v2/types?context=edit',
42 '/surecart/v1/affiliation_requests/' . $request->query( 'id' ) . '?context=edit',
43 ]
44 );
45
46 // return view.
47 return '<div id="app"></div>';
48 }
49 }
50