MMCT TEAM
Server IP : 162.214.80.37  /  Your IP : 216.73.216.68
Web Server : Apache
System : Linux sh013.webhostingservices.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : imyrqtmy ( 2189)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /opt/wp/plugins/bluehost-wordpress-plugin/inc/RestApi/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //opt/wp/plugins/bluehost-wordpress-plugin/inc/RestApi/MojoServicesController.php
<?php

namespace Bluehost\RestApi;

/**
 * Class MojoServicesController
 */
class MojoServicesController extends MojoItemsController {

	/**
	 * The base of this controller's route.
	 *
	 * @var string
	 */
	protected $rest_base = 'services';

	/**
	 * Register the routes for the objects of the controller.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base,
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_items' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
					'args'                => $this->get_collection_params(),
				),
			)
		);
	}

	/**
	 * Get a collection of items
	 *
	 * @param \WP_REST_Request $request Full data about the request.
	 *
	 * @return \WP_Error|\WP_REST_Response
	 */
	public function get_items( $request ) {
		$params = array( 'item_type' => 'services' );
		$data   = $this->query_mojo_search( $params, $request );

		return rest_ensure_response( $data );
	}

}

MMCT - 2023