GhostManSec
Server: LiteSpeed
System: Linux premium197.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: parhudrw (1725)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/parhudrw/emenu.anqa.it/wp-content/plugins/hello-plus/modules/admin/classes/rest/whats-new.php
<?php
namespace HelloPlus\Modules\Admin\Classes\Rest;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

use HelloPlus\Modules\Admin\Module;

class Whats_New {
	public function get_notifications() {
		/**
		 * @var \HelloPlus\Modules\Admin\Components\Notificator $notifications_component
		 */
		$notifications_component = Module::instance()->get_component( 'Notificator' );
		return $notifications_component->get_notifications_by_conditions( true );
	}

	public function rest_api_init() {
		register_rest_route(
			'elementor-hello-plus/v1',
			'/whats-new',
			[
				'methods' => \WP_REST_Server::READABLE,
				'callback' => [ $this, 'get_notifications' ],
				'permission_callback' => function () {
					return current_user_can( 'manage_options' );
				},
			]
		);
	}

	public function __construct() {
		add_action( 'rest_api_init', [ $this, 'rest_api_init' ] );
	}
}