/** * Rest API functions * * @package GenerateBlocks */ if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Class GenerateBlocks_Rest */ class GeneratePress_Rest extends WP_REST_Controller { /** * Instance. * * @access private * @var object Instance */ private static $instance; /** * Namespace. * * @var string */ protected $namespace = 'generatepress/v'; /** * Version. * * @var string */ protected $version = '1'; /** * Initiator. * * @return object initialized object of class. */ public static function get_instance() { if ( ! isset( self::$instance ) ) { self::$instance = new self(); } return self::$instance; } /** * GeneratePress_Rest constructor. */ public function __construct() { add_action( 'rest_api_init', array( $this, 'register_routes' ) ); } /** * Register rest routes. */ public function register_routes() { $namespace = $this->namespace . $this->version; register_rest_route( $namespace, '/reset/', array( 'methods' => WP_REST_Server::EDITABLE, 'callback' => array( $this, 'reset' ), 'permission_callback' => array( $this, 'update_settings_permission' ), ) ); } /** * Get edit options permissions. * * @return bool */ public function update_settings_permission() { return current_user_can( 'manage_options' ); } /** * Reset settings. * * @param WP_REST_Request $request request object. * * @return mixed */ public function reset( WP_REST_Request $request ) { delete_option( 'generate_settings' ); delete_option( 'generate_dynamic_css_output' ); delete_option( 'generate_dynamic_css_cached_version' ); return $this->success( __( 'Settings reset.', 'generatepress' ) ); } /** * Success rest. * * @param mixed $response response data. * @return mixed */ public function success( $response ) { return new WP_REST_Response( array( 'success' => true, 'response' => $response, ), 200 ); } /** * Failed rest. * * @param mixed $response response data. * @return mixed */ public function failed( $response ) { return new WP_REST_Response( array( 'success' => false, 'response' => $response, ), 200 ); } /** * Error rest. * * @param mixed $code error code. * @param mixed $response response data. * @return mixed */ public function error( $code, $response ) { return new WP_REST_Response( array( 'error' => true, 'success' => false, 'error_code' => $code, 'response' => $response, ), 401 ); } } GeneratePress_Rest::get_instance(); Download Premium Mod APP - APKDone

APP

Gradient MOD APK

Gradient MOD APK 2.10.16 (Premium Unlocked)

Owi Editor

Gradient MOD APK: Are you getting bored by the simple and generic beauty effects with the same setups across different ...

GBWhatsapp

Download GBWhatsapp Latest Version 2024

Owi Editor

GB Whatsapp is 100% SAFE, with its security verified by multiple virus & malware detection engines. You can also scan ...

spotify Spotify Premium MOD APK

Spotify Premium MOD APK 8.9.18.512 (Unlocked)

Owi Editor

For music lovers, there isn’t a better way to relax than being able to sit down, put on your headphones, ...

Airtel Xstream Mod Apk

Airtel Xstream Mod Apk Unlocked

Owi Editor

Airtel Xstream Mod Apk: Mainstream cables are beginning to lose their importance as well as attraction in recent years. Instead, ...

Infinite Design MOD APK

Infinite Design MOD APK 3.5.6 (Premium Unlocked)

Owi Editor

Drawing and art, in general, was a costly and time-consuming hobby in the past. That’s said, you were required to ...

Vortex Cloud Gaming MOD APK

Vortex Cloud Gaming MOD APK 2.0.1 (Free Subscription)

Owi Editor

If there is one thing that you could say about the gaming hobby in general, we all know that it’s ...

FaceApp MOD APK

FaceApp MOD APK 11.9.0 (Pro Unlocked)

Owi Editor

Create stunning selfies with FaceApp! Try the AI-powered photo editor and change your hairstyle, makeup, or eye color. Intro Have ...

Turbo VPN MOD APK

Turbo VPN MOD APK 4.0.5.4 (Premium Unlocked)

Owi Editor

Turbo VPN is the fastest and most reliable VPN app on the market! Browse securely, access any content, and enjoy ...

Avee Music Player Pro MOD APK

Avee Music Player Pro MOD APK 1.2.227 (Premium)

Owi Editor

Are you bored by the simple and uninteresting music app that comes with your original devices? Looking for a change ...

APKdone APK

Download APKdone APK Latest Version

Owi Editor

Introduction: Embracing the APKdone APK Experience At APKdone, we pride ourselves on delivering an unparalleled experience to our users seeking ...