HEX
Server: LiteSpeed
System: Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
User: swifizcd (1555)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //home/swifizcd/buyease.com.ng/wp-content/plugins/essential-blocks/includes/API/Common.php
<?php

namespace EssentialBlocks\API;

class Common extends Base
{
    /**
     * Register REST Routes
     *
     * @return void
     */
    public function register()
    {
        $this->get('roles', [
            'callback' => [$this, 'get_roles'],
            'permission_callback' => [$this, 'check_edit_page_permission']
        ]);
    }

    /**
     * Check if user has permission to edit pages
     *
     * @return bool
     */
    public function check_edit_page_permission()
    {
        return current_user_can('edit_posts');
    }

    public function get_roles()
    {
        global $wp_roles;
        return rest_ensure_response($wp_roles->roles);
    }
}